(split_groups): Test the pointer returned by malloc.

This commit is contained in:
nekral-guest 2008-01-01 20:47:31 +00:00
parent 6f45325d6e
commit 631fa3b4f3
2 changed files with 8 additions and 0 deletions

View File

@ -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(),

View 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;