Forgot to free two variables upon errors (thanks to cppcheck)
This commit is contained in:
parent
28bdf37c4e
commit
66fe4e26a3
4
src/id.c
4
src/id.c
|
@ -199,14 +199,18 @@ static int _id_all(char const * user)
|
||||||
if((pw = getpwuid(geteuid())) == NULL)
|
if((pw = getpwuid(geteuid())) == NULL)
|
||||||
{
|
{
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
|
free(u);
|
||||||
return _id_error("getpwuid", 1);
|
return _id_error("getpwuid", 1);
|
||||||
}
|
}
|
||||||
printf(" euid=%u(%s) e", (unsigned)pw->pw_uid,
|
printf(" euid=%u(%s) e", (unsigned)pw->pw_uid,
|
||||||
pw->pw_name);
|
pw->pw_name);
|
||||||
if(_print_gid(pw->pw_gid) == NULL)
|
if(_print_gid(pw->pw_gid) == NULL)
|
||||||
|
{
|
||||||
|
free(u);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if((pw = getpwnam(user)) == NULL)
|
if((pw = getpwnam(user)) == NULL)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user