aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/posix/chgrp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c
index e416f27f..0a314c2a 100644
--- a/toys/posix/chgrp.c
+++ b/toys/posix/chgrp.c
@@ -90,6 +90,7 @@ void chgrp_main(void)
if (!p && isdigit(*own)) p=getpwuid(atoi(own));
if (!p) error_exit("no user '%s'", own);
TT.owner = p->pw_uid;
+ if (CFG_TOYBOX_FREE) free(own);
}
} else TT.group_name = *toys.optargs;
@@ -106,6 +107,4 @@ void chgrp_main(void)
if (new) dirtree_handle_callback(new, do_chgrp);
else toys.exitval = 1;
}
-
- if (CFG_TOYBOX_FREE) free(own);
}