Merge pull request #291 from ikerexxe/covscan_issues
Two covscan issues
This commit is contained in:
commit
e7938d5a30
@ -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++;
|
||||||
|
|
||||||
|
@ -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 ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user