added a check to avoid freeing null pointer
This commit is contained in:
parent
c0f0c67864
commit
97bb5b2b6d
@ -290,6 +290,7 @@ static int add_group (const char *name, const char *gid, gid_t *ngid, uid_t uid)
|
|||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: invalid group name '%s'\n"),
|
_("%s: invalid group name '%s'\n"),
|
||||||
Prog, grent.gr_name);
|
Prog, grent.gr_name);
|
||||||
|
if (grent.gr_name)
|
||||||
free (grent.gr_name);
|
free (grent.gr_name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user