]> granicus.if.org Git - shadow/commitdiff
(split_groups): Test the pointer returned by malloc.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 1 Jan 2008 20:47:31 +0000 (20:47 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 1 Jan 2008 20:47:31 +0000 (20:47 +0000)
ChangeLog
lib/groupio.c

index 07696454408c092e6bccd6e6b867eef7a865f911..bc0e673d2f82ff25b7a43ba86b5f30acb79f14f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-01  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * lib/groupio.c (split_groups): Test the pointer returned by malloc.
+
 2008-01-01  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/commonio.c: Document add_one_entry_nis(), write_all(),
index 1881a5947a0dd11124159ac5f5fa2b7078e8aa82..a519bc801bda414b983d41814a5a8cf9e2d5a7d6 100644 (file)
@@ -332,6 +332,10 @@ static int split_groups (unsigned int max_members)
                        continue;
 
                new = (struct commonio_entry *) malloc (sizeof *new);
+               if (NULL == new) {
+                       errno = ENOMEM;
+                       return 0;
+               }
                new->eptr = group_dup(gr->eptr);
                if (NULL == new->eptr) {
                        errno = ENOMEM;