From 97bb5b2b6dda6cafb723ecf0701c1499ac06097c Mon Sep 17 00:00:00 2001 From: rahul Date: Mon, 22 Jan 2018 17:05:52 +0530 Subject: [PATCH] added a check to avoid freeing null pointer --- src/newusers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/newusers.c b/src/newusers.c index c38aec4b..664313fc 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; }