Merge pull request #291 from ikerexxe/covscan_issues

Two covscan issues
This commit is contained in:
Serge Hallyn 2020-11-08 16:33:55 -06:00 committed by GitHub
commit e7938d5a30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -445,7 +445,6 @@ int main (int argc, char **argv)
Prog = Basename (argv[0]); Prog = Basename (argv[0]);
is_newgrp = (strcmp (Prog, "newgrp") == 0); is_newgrp = (strcmp (Prog, "newgrp") == 0);
OPENLOG (is_newgrp ? "newgrp" : "sg"); OPENLOG (is_newgrp ? "newgrp" : "sg");
gid = getgid ();
argc--; argc--;
argv++; argv++;

View File

@ -729,7 +729,7 @@ static int set_defaults (void)
static int get_groups (char *list) static int get_groups (char *list)
{ {
char *cp; char *cp;
const struct group *grp; struct group *grp;
int errors = 0; int errors = 0;
int ngroups = 0; int ngroups = 0;
@ -808,6 +808,7 @@ static int get_groups (char *list)
* Add the group name to the user's list of groups. * Add the group name to the user's list of groups.
*/ */
user_groups[ngroups++] = xstrdup (grp->gr_name); user_groups[ngroups++] = xstrdup (grp->gr_name);
free (grp);
} while (NULL != list); } while (NULL != list);
close_group_files (); close_group_files ();