diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-05-14 00:22:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-05-14 00:22:24 +0000 |
commit | d60d215c57261eb35e540fa13c04f6dc0957c476 (patch) | |
tree | 3cb67186a7f009cce81dd34870ae016617b9e4bb /nss/getXXbyYY.c | |
parent | c22ecc52699cbc60f83b2a7ab49cec5992d850cd (diff) | |
download | glibc-d60d215c57261eb35e540fa13c04f6dc0957c476.tar glibc-d60d215c57261eb35e540fa13c04f6dc0957c476.tar.gz glibc-d60d215c57261eb35e540fa13c04f6dc0957c476.tar.bz2 glibc-d60d215c57261eb35e540fa13c04f6dc0957c476.zip |
Update.
1999-05-14 Ulrich Drepper <drepper@cygnus.com>
* nss/getXXbyYY.c: Add free_mem function which disposes all
statically allocated memory when debugging.
* nss/getXXent.c: Likewise.
* nss/nsswitch.c: Likewise.
Diffstat (limited to 'nss/getXXbyYY.c')
-rw-r--r-- | nss/getXXbyYY.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c index 16f01dedf2..15cdcba3ff 100644 --- a/nss/getXXbyYY.c +++ b/nss/getXXbyYY.c @@ -72,11 +72,13 @@ extern int INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, /* We need to protect the dynamic buffer handling. */ __libc_lock_define_initialized (static, lock); +/* This points to the static buffer used. */ +static char *buffer; + LOOKUP_TYPE * FUNCTION_NAME (ADD_PARAMS) { - static char *buffer; static size_t buffer_size; static LOOKUP_TYPE resbuf; LOOKUP_TYPE *result; @@ -151,3 +153,14 @@ done: return result; } + + +/* Free all resources if necessary. */ +static void __attribute__ ((unused)) +free_mem (void) +{ + if (buffer != NULL) + free (buffer); +} + +text_set_element (__libc_subfreeres, free_mem); |