diff --git a/usr.sbin/chown/chown.c b/usr.sbin/chown/chown.c index 0b09813a7e63..e13235c3119e 100644 --- a/usr.sbin/chown/chown.c +++ b/usr.sbin/chown/chown.c @@ -290,6 +290,7 @@ chownerr(const char *file) err(1, "malloc"); ngroups = getgroups(ngroups_max, groups); while (--ngroups >= 0 && gid != groups[ngroups]); + free(groups); if (ngroups < 0) { warnx("you are not a member of group %s", gname); return;