]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
added a check to avoid freeing null pointer
authorrahul <rahul1809>
Mon, 22 Jan 2018 11:35:52 +0000 (17:05 +0530)
committerrahul <rahul1809>
Mon, 22 Jan 2018 11:35:52 +0000 (17:05 +0530)
src/newusers.c

index c38aec4b43b85163a5b9ae832d4ce0c6e41cf69e..664313fc62c36268638bdbc696781d46ef2f216b 100644 (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;
        }