aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
Diffstat (limited to 'time')
-rw-r--r--time/tzfile.c13
-rw-r--r--time/tzset.c4
2 files changed, 2 insertions, 15 deletions
diff --git a/time/tzfile.c b/time/tzfile.c
index 5c2b28d..24ef18f 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -49,7 +49,7 @@ static struct ttinfo *find_transition (time_t timer) internal_function;
static void compute_tzname_max (size_t) internal_function;
static size_t num_transitions;
-static time_t *transitions;
+libc_freeres_ptr (static time_t *transitions);
static unsigned char *type_idxs;
static size_t num_types;
static struct ttinfo *types;
@@ -553,14 +553,3 @@ compute_tzname_max (size_t chars)
}
while (++p < &zone_names[chars]);
}
-
-/* This function is only called when we are checking for memory leaks. */
-static void
-freeres (void)
-{
- if (transitions != NULL)
- free ((void *) transitions);
-}
-
-/* Make sure all allocated data is freed before exiting. */
-text_set_element (__libc_subfreeres, freeres);
diff --git a/time/tzset.c b/time/tzset.c
index c9a9783..0294058 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -624,8 +624,7 @@ __tz_convert (const time_t *timer, int use_localtime, struct tm *tp)
}
-static void
-free_mem (void)
+libc_freeres_fn (free_mem)
{
while (tzstring_list != NULL)
{
@@ -637,4 +636,3 @@ free_mem (void)
free (old_tz);
old_tz = NULL;
}
-text_set_element (__libc_subfreeres, free_mem);