From ed2ced8ae324a8a89a76ff3fc3971226b0107d3e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 10 Nov 2004 07:54:40 +0000 Subject: Update. 2004-11-10 Jakub Jelinek * Makefile (tests): Add tst-exit3. * tst-exit3.c: New test. --- nscd/nscd_gethst_r.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'nscd/nscd_gethst_r.c') diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c index 64d02fe..5d9d569 100644 --- a/nscd/nscd_gethst_r.c +++ b/nscd/nscd_gethst_r.c @@ -87,14 +87,18 @@ __nscd_gethostbyaddr_r (const void *addr, socklen_t len, int type, } -libc_locked_map_ptr (map_handle); +libc_locked_map_ptr (, __hst_map_handle); /* Note that we only free the structure if necessary. The memory mapping is not removed since it is not visible to the malloc handling. */ -libc_freeres_fn (gr_map_free) +libc_freeres_fn (hst_map_free) { - if (map_handle.mapped != NO_MAPPING) - free (map_handle.mapped); + if (__hst_map_handle.mapped != NO_MAPPING) + { + void *p = __hst_map_handle.mapped; + __hst_map_handle.mapped = NO_MAPPING; + free (p); + } } @@ -110,7 +114,8 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type, /* If the mapping is available, try to search there instead of communicating with the nscd. */ struct mapped_database *mapped; - mapped = __nscd_get_map_ref (GETFDHST, "hosts", &map_handle, &gc_cycle); + mapped = __nscd_get_map_ref (GETFDHST, "hosts", &__hst_map_handle, + &gc_cycle); retry:; const hst_response_header *hst_resp = NULL; -- cgit v1.1