hare

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

commit 57d0cf3912b563b0e50267163f6f76bc78789616
parent 2eab33f08315016a6d5edaf5021555cf6b68aa0b
Author: iamthenoname <iamthenoname@perso.be>
Date:   Sun, 30 Apr 2023 20:18:15 +0800

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

Signed-off-by: iamthenoname <iamthenoname@perso.be>

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

diff --git a/time/chrono/tzdb.ha b/time/chrono/tzdb.ha @@ -188,6 +188,7 @@ 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 @@ -236,6 +237,8 @@ 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); };