summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-10-04 21:07:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:09 -0500
commite28ae1f5fd904b99403e31edbb1ca41f77dc1dee (patch)
tree3afdfd5b7c8dff4de7b0fac003f02ed4413fb304 /source3/lib
parent407873df53db6fb7302ffda53de214e64cd75a09 (diff)
downloadsamba-e28ae1f5fd904b99403e31edbb1ca41f77dc1dee.tar.gz
samba-e28ae1f5fd904b99403e31edbb1ca41f77dc1dee.tar.bz2
samba-e28ae1f5fd904b99403e31edbb1ca41f77dc1dee.zip
r19080: Fix a potential NULL dereference
(This used to be commit 682b490c23bb88a1a570bd1fcb7d2b6aa778dd14)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index e04ed977bb..19c6cab5b2 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -312,6 +312,13 @@ void add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
{
int i;
+ if ((*num_gids != 0) && (*gids == NULL)) {
+ /*
+ * A former call to this routine has failed to allocate memory
+ */
+ return;
+ }
+
for (i=0; i<*num_gids; i++) {
if ((*gids)[i] == gid)
return;