mirror of
https://github.com/samba-team/samba.git
synced 2025-12-12 12:23:50 +03:00
r19080: Fix a potential NULL dereference
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
7b6738522a
commit
682b490c23
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user