about summary refs log tree commit diff
path: root/nscd/nscd_getgr_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-11-10 07:54:40 +0000
committerUlrich Drepper <drepper@redhat.com>2004-11-10 07:54:40 +0000
commited2ced8ae324a8a89a76ff3fc3971226b0107d3e (patch)
tree73b9742b4eddf42b5b446289837132b62552befd /nscd/nscd_getgr_r.c
parent5429ff760a5544a34c5f05f16c01a7dffa505604 (diff)
downloadglibc-ed2ced8ae324a8a89a76ff3fc3971226b0107d3e.tar.gz
glibc-ed2ced8ae324a8a89a76ff3fc3971226b0107d3e.tar.xz
glibc-ed2ced8ae324a8a89a76ff3fc3971226b0107d3e.zip
2004-11-10  Jakub Jelinek  <jakub@redhat.com>

	* Makefile (tests): Add tst-exit3.
	* tst-exit3.c: New test.
Diffstat (limited to 'nscd/nscd_getgr_r.c')
-rw-r--r--nscd/nscd_getgr_r.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c
index fc10d3ea60..282912db3e 100644
--- a/nscd/nscd_getgr_r.c
+++ b/nscd/nscd_getgr_r.c
@@ -67,14 +67,18 @@ __nscd_getgrgid_r (gid_t gid, struct group *resultbuf, char *buffer,
 }
 
 
-libc_locked_map_ptr (map_handle);
+libc_locked_map_ptr (,__gr_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)
 {
-  if (map_handle.mapped != NO_MAPPING)
-    free (map_handle.mapped);
+  if (__gr_map_handle.mapped != NO_MAPPING)
+    {
+      void *p = __gr_map_handle.mapped;
+      __gr_map_handle.mapped = NO_MAPPING;
+      free (p);
+    }
 }
 
 
@@ -91,7 +95,8 @@ nscd_getgr_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 = __nscd_get_map_ref (GETFDGR, "group",
-						       &map_handle, &gc_cycle);
+						       &__gr_map_handle,
+						       &gc_cycle);
  retry:;
   const gr_response_header *gr_resp = NULL;
   const char *gr_name = NULL;