hare

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

commit 9654a72704224d80cd08db9410337ff0aebc83cd
parent 0cfa57527317b8c56d63decc5a97b4cb5e9448e4
Author: Autumn! <autumnull@posteo.net>
Date:   Mon,  8 May 2023 16:16:47 +0000

time::chrono: load_tzif: fix memory leak

Signed-off-by: Autumn! <autumnull@posteo.net>

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

diff --git a/time/chrono/tzdb.ha b/time/chrono/tzdb.ha @@ -228,12 +228,12 @@ fn load_tzif(h: io::handle, tz: *timezone) (void | invalidtzif | io::error) = { if (len(bytes) == 0) { // no NUL encountered return invalidtzif; }; - const abbr = strings::dup(match (strings::fromutf8(bytes)) { + const abbr = match (strings::fromutf8(bytes)) { case let s: str => yield s; case encoding::utf8::invalid => return invalidtzif; - }); + }; zone.abbr = strings::dup(abbr); append(zones, zone);