]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix reallocation bug in last nss_files change.
authorUlrich Drepper <drepper@gmail.com>
Thu, 21 Apr 2011 16:07:52 +0000 (12:07 -0400)
committerUlrich Drepper <drepper@gmail.com>
Thu, 21 Apr 2011 16:07:52 +0000 (12:07 -0400)
ChangeLog
nss/nss_files/files-initgroups.c

index 934a23cb3f5cd000c1ec5fc3cf6c50af8b8581c2..0c8282e168462ec10325c463272b18635f36242e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-21  Ulrich Drepper  <drepper@gmail.com>
+
+       * nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn): Fix
+       problem in reallocation in last patch.
+
 2011-04-20  Ulrich Drepper  <drepper@gmail.com>
 
        * sunrpc/Makefile: Move inclusion of Rules.
index 1c288e5ae3697c8b3c1495d35bf8bd8dff5a36d9..4c7b9f8e6f4a5c5e07809c1327f2ea61f46131d8 100644 (file)
@@ -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;