about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-24 08:28:11 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-24 08:28:11 +0000
commit83628d3173a478193ad3c008c948ca999308d28a (patch)
tree8bd542a9565a4b868957d3425e3c887e1bc52343
parentd5fb902b068a11c22683e0398afe911e07809a4a (diff)
downloadglibc-83628d3173a478193ad3c008c948ca999308d28a.tar.gz
glibc-83628d3173a478193ad3c008c948ca999308d28a.tar.xz
glibc-83628d3173a478193ad3c008c948ca999308d28a.zip
(free_mem): New function. Free allocated memory.
-rw-r--r--time/tzset.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/time/tzset.c b/time/tzset.c
index e8a3e924e2..31dfc9b7bc 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -625,3 +625,19 @@ __tz_convert (const time_t *timer, int use_localtime, struct tm *tp)
 
   return tp;
 }
+
+
+static void
+free_mem (void)
+{
+  while (tzstring_list != NULL)
+    {
+      struct tzstring_l *old = tzstring_list;
+
+      tzstring_list = tzstring_list->next;
+      free (old);
+    }
+  free (old_tz);
+  old_tz = NULL;
+}
+text_set_element (__libc_subfreeres, free_mem);