]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__tzset_internal): Fix memory leak when the user specifies a TZ value
authorUlrich Drepper <drepper@redhat.com>
Sat, 23 Aug 1997 21:52:31 +0000 (21:52 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 23 Aug 1997 21:52:31 +0000 (21:52 +0000)
that uses a default rule file.  Do not assume US DST rules when the
user specifies that there is no DST.

time/tzset.c

index 42b006e0c17be8c51cb0c857f967038cb37e155b..e0c39552ca0c332be7785831452cae6e8ce36e61 100644 (file)
@@ -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);