hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 6b646277dbd6d37bbc62f21610023ffa61e84bef
parent c3d027a2768f46652c6282287970e99c20ca5c4e
Author: Bor Grošelj Simić <bgs@turminal.net>
Date:   Tue,  2 May 2023 02:02:00 +0200

Revert "time::chrono: fix memory leak in load_tzif()"

This reverts commit 57d0cf3912b563b0e50267163f6f76bc78789616.

It wasn't a memory leak, the string is needed as part of the time zone
structure. Freeing it here causes a double free that somehow went
undetected.

Diffstat:
Mtime/chrono/tzdb.ha | 3---
1 file changed, 0 insertions(+), 3 deletions(-)

diff --git a/time/chrono/tzdb.ha b/time/chrono/tzdb.ha @@ -188,7 +188,6 @@ fn load_tzif(h: io::handle, tz: *timezone) (void | invalidtzif | io::error) = { case encoding::utf8::invalid => return invalidtzif; }); - defer free(posix_extend); // assemble structured data @@ -237,8 +236,6 @@ fn load_tzif(h: io::handle, tz: *timezone) (void | invalidtzif | io::error) = { return invalidtzif; }); zone.abbr = strings::dup(abbr); - defer free(abbr); - defer free(zone.abbr); append(zones, zone); };