summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-04-21 12:07:52 -0400
committerUlrich Drepper <drepper@gmail.com>2011-04-21 12:07:52 -0400
commite84142d2a9eed278ecf869459a5de0b640074517 (patch)
treee2e8596951350928fb3b3cac9b897810fe3ab4e3 /nss
parent877175d8ea2e0182909e04cac603017ca31022ef (diff)
downloadglibc-e84142d2a9eed278ecf869459a5de0b640074517.tar.gz
glibc-e84142d2a9eed278ecf869459a5de0b640074517.tar.xz
glibc-e84142d2a9eed278ecf869459a5de0b640074517.zip
Fix reallocation bug in last nss_files change.
Diffstat (limited to 'nss')
-rw-r--r--nss/nss_files/files-initgroups.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c
index 1c288e5ae3..4c7b9f8e6f 100644
--- a/nss/nss_files/files-initgroups.c
+++ b/nss/nss_files/files-initgroups.c
@@ -70,7 +70,8 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
 	  size_t newbuflen = 2 * buflen;
 	  if (buffer_use_malloc || ! __libc_use_alloca (buflen + newbuflen))
 	    {
-	      char *newbuf = realloc (buffer, buflen);
+	      void *newbuf = realloc (buffer_use_malloc ? buffer : NULL,
+				      buflen);
 	      if (newbuf == NULL)
 		{
 		  *errnop = ENOMEM;