summary refs log tree commit diff
path: root/sysdeps/generic/setenv.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-31 20:30:50 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-31 20:30:50 +0000
commit69071b2ab6e27435b9a2d610b1b5b8c48ea92940 (patch)
treeca9f505c9ec9bd00af82a592dc93e474c749fce8 /sysdeps/generic/setenv.c
parent736dda8c7fa5003ea99708e7b87a2d22c0425db7 (diff)
downloadglibc-69071b2ab6e27435b9a2d610b1b5b8c48ea92940.tar.gz
glibc-69071b2ab6e27435b9a2d610b1b5b8c48ea92940.tar.xz
glibc-69071b2ab6e27435b9a2d610b1b5b8c48ea92940.zip
Update.
	* sysdeps/generic/setenv.c (free_mem): New function.  Free all
	allocated memory.
Diffstat (limited to 'sysdeps/generic/setenv.c')
-rw-r--r--sysdeps/generic/setenv.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c
index ae19721ef7..b8d234929f 100644
--- a/sysdeps/generic/setenv.c
+++ b/sysdeps/generic/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 95, 96, 97, 98, 99, 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
@@ -313,6 +313,19 @@ clearenv ()
   return 0;
 }
 #ifdef _LIBC
+static void
+free_mem (void)
+{
+  /* Remove all traces.  */
+  clearenv ();
+
+  /* Now remove the search tree.  */
+  __tdestroy (known_values, free);
+  known_values = NULL;
+}
+text_set_element (__libc_subfreeres, free_mem);
+
+
 # undef setenv
 # undef unsetenv
 # undef clearenv