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:
parent
407873df53
commit
e28ae1f5fd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user