mirror of
https://github.com/samba-team/samba.git
synced 2025-12-14 20:23:54 +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;
|
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++) {
|
for (i=0; i<*num_gids; i++) {
|
||||||
if ((*gids)[i] == gid)
|
if ((*gids)[i] == gid)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user