hare

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

commit a4a13cb81abc69b3cf970701e48807b23bf61a69
parent bd0a080ab89d45806ec5c466ba861e4509d770a9
Author: Byron Torres <b@torresjrjr.com>
Date:   Wed, 14 Jun 2023 23:25:29 +0100

time::chrono: fix $TZ causing TZ_LOCAL double-free

Signed-off-by: Byron Torres <b@torresjrjr.com>

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

diff --git a/time/chrono/timezone.ha b/time/chrono/timezone.ha @@ -211,11 +211,9 @@ let TZ_LOCAL: timezone = timezone { @init fn init_tz_local() void = { match (os::getenv("TZ")) { case let timezone: str => - TZ_LOCAL = match (tz(timezone)) { + match (tz(timezone)) { case let loc: locality => - const tz = *loc; - timezone_free(loc); - yield tz; + TZ_LOCAL = *loc; case => return; };