[Pkg-shadow-commits] r1620 - in upstream/trunk: . lib

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Tue Jan 1 20:47:31 UTC 2008


Author: nekral-guest
Date: 2008-01-01 20:47:31 +0000 (Tue, 01 Jan 2008)
New Revision: 1620

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/groupio.c
Log:
(split_groups): Test the pointer returned by malloc.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-01-01 20:34:47 UTC (rev 1619)
+++ upstream/trunk/ChangeLog	2008-01-01 20:47:31 UTC (rev 1620)
@@ -1,5 +1,9 @@
 2008-01-01  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* lib/groupio.c (split_groups): Test the pointer returned by malloc.
+
+2008-01-01  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* lib/commonio.c: Document add_one_entry_nis(), write_all(),
 	commonio_remove(), commonio_locate(), and commonio_rewind().
 

Modified: upstream/trunk/lib/groupio.c
===================================================================
--- upstream/trunk/lib/groupio.c	2008-01-01 20:34:47 UTC (rev 1619)
+++ upstream/trunk/lib/groupio.c	2008-01-01 20:47:31 UTC (rev 1620)
@@ -332,6 +332,10 @@
 			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;




More information about the Pkg-shadow-commits mailing list