Plug resource leak.
Found with: Coverity Prevent CID: 7040
This commit is contained in:
parent
dc5a530b04
commit
3e6ce93ee1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208815
@ -290,6 +290,7 @@ chownerr(const char *file)
|
|||||||
err(1, "malloc");
|
err(1, "malloc");
|
||||||
ngroups = getgroups(ngroups_max, groups);
|
ngroups = getgroups(ngroups_max, groups);
|
||||||
while (--ngroups >= 0 && gid != groups[ngroups]);
|
while (--ngroups >= 0 && gid != groups[ngroups]);
|
||||||
|
free(groups);
|
||||||
if (ngroups < 0) {
|
if (ngroups < 0) {
|
||||||
warnx("you are not a member of group %s", gname);
|
warnx("you are not a member of group %s", gname);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user