added a check to avoid freeing null pointer

This commit is contained in:
rahul 2018-01-22 17:05:52 +05:30
parent c0f0c67864
commit 97bb5b2b6d

View File

@ -290,6 +290,7 @@ static int add_group (const char *name, const char *gid, gid_t *ngid, uid_t uid)
fprintf (stderr,
_("%s: invalid group name '%s'\n"),
Prog, grent.gr_name);
if (grent.gr_name)
free (grent.gr_name);
return -1;
}