diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/efgcvt.c | 14 | ||||
-rw-r--r-- | misc/fstab.c | 6 | ||||
-rw-r--r-- | misc/mntent.c | 16 |
3 files changed, 5 insertions, 31 deletions
diff --git a/misc/efgcvt.c b/misc/efgcvt.c index bc4bf91d02..915d00dfd5 100644 --- a/misc/efgcvt.c +++ b/misc/efgcvt.c @@ -1,5 +1,5 @@ /* Compatibility functions for floating point formatting. - Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999, 2002 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 @@ -57,7 +57,7 @@ static char FCVT_BUFFER[MAXDIG]; static char ECVT_BUFFER[MAXDIG]; -static char *FCVT_BUFPTR; +libc_freeres_ptr (static char *FCVT_BUFPTR); char * APPEND (FUNC_PREFIX, fcvt) (value, ndigit, decpt, sign) @@ -102,13 +102,3 @@ APPEND (FUNC_PREFIX, gcvt) (value, ndigit, buf) sprintf (buf, "%.*" FLOAT_FMT_FLAG "g", MIN (ndigit, NDIGIT_MAX), value); return buf; } - -/* Free all resources if necessary. */ -static void __attribute__ ((unused)) -free_mem (void) -{ - if (FCVT_BUFPTR != NULL) - free (FCVT_BUFPTR); -} - -text_set_element (__libc_subfreeres, free_mem); diff --git a/misc/fstab.c b/misc/fstab.c index 754ea1343a..b434203a86 100644 --- a/misc/fstab.c +++ b/misc/fstab.c @@ -180,9 +180,7 @@ fstab_convert (struct fstab_state *state) /* Make sure the memory is freed if the programs ends while in memory-debugging mode and something actually was allocated. */ -static void -__attribute__ ((unused)) -fstab_free (void) +libc_freeres_fn (fstab_free) { char *buffer; @@ -190,5 +188,3 @@ fstab_free (void) if (buffer != NULL) free ((void *) buffer); } - -text_set_element (__libc_subfreeres, fstab_free); diff --git a/misc/mntent.c b/misc/mntent.c index d7cff3c302..6e9795a1ea 100644 --- a/misc/mntent.c +++ b/misc/mntent.c @@ -1,5 +1,5 @@ /* Utilities for reading/writing fstab, mtab, etc. - Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 2000, 2002 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 @@ -24,7 +24,7 @@ /* We don't want to allocate the static buffer all the time since it is not always used (in fact, rather infrequently). Accept the extra cost of a `malloc'. */ -static char *getmntent_buffer; +libc_freeres_ptr (static char *getmntent_buffer); /* This is the size of the buffer. This is really big. */ #define BUFFER_SIZE 4096 @@ -52,15 +52,3 @@ getmntent (FILE *stream) return __getmntent_r (stream, &m, getmntent_buffer, BUFFER_SIZE); } - - -/* Make sure the memory is freed if the programs ends while in - memory-debugging mode and something actually was allocated. */ -static void -__attribute__ ((unused)) -free_mem (void) -{ - free (getmntent_buffer); -} - -text_set_element (__libc_subfreeres, free_mem); |