From: nekral-guest Date: Tue, 1 Jan 2008 20:47:31 +0000 (+0000) Subject: (split_groups): Test the pointer returned by malloc. X-Git-Tag: 4.1.1~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=631fa3b4f3c025eb21557cf668071d91be9a43fe;p=shadow (split_groups): Test the pointer returned by malloc. --- diff --git a/ChangeLog b/ChangeLog index 07696454..bc0e673d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-01 Nicolas François + + * lib/groupio.c (split_groups): Test the pointer returned by malloc. + 2008-01-01 Nicolas François * lib/commonio.c: Document add_one_entry_nis(), write_all(), diff --git a/lib/groupio.c b/lib/groupio.c index 1881a594..a519bc80 100644 --- a/lib/groupio.c +++ b/lib/groupio.c @@ -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;