From d59621d7d8271fab082bdb11e0f94e92b99a0942 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 23 Aug 1997 21:52:31 +0000 Subject: [PATCH] (__tzset_internal): Fix memory leak when the user specifies a TZ value that uses a default rule file. Do not assume US DST rules when the user specifies that there is no DST. --- time/tzset.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/time/tzset.c b/time/tzset.c index 42b006e0c17..e0c39552ca0 100644 --- a/time/tzset.c +++ b/time/tzset.c @@ -313,13 +313,18 @@ __tzset_internal (always) { free (old_tz); old_tz = NULL; + free (tzbuf); return; } } } else - /* There is no DST. */ - tz_rules[1].name = tz_rules[0].name; + { + /* There is no DST. */ + tz_rules[1].name = tz_rules[0].name; + free (tzbuf); + return; + } done_names: free (tzbuf); -- 2.47.2