1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r19080: Fix a potential NULL dereference

(This used to be commit 682b490c23)
This commit is contained in:
Volker Lendecke 2006-10-04 21:07:05 +00:00 committed by Gerald (Jerry) Carter
parent 407873df53
commit e28ae1f5fd

View File

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