From: rahul Date: Mon, 22 Jan 2018 11:35:52 +0000 (+0530) Subject: added a check to avoid freeing null pointer X-Git-Tag: 4.6~11^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=97bb5b2b6dda6cafb723ecf0701c1499ac06097c;p=thirdparty%2Fshadow.git added a check to avoid freeing null pointer --- diff --git a/src/newusers.c b/src/newusers.c index c38aec4b4..664313fc6 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -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; }