diff options
author | Felix Janda <felix.janda@posteo.de> | 2012-12-30 11:53:27 +0100 |
---|---|---|
committer | Felix Janda <felix.janda@posteo.de> | 2012-12-30 11:53:27 +0100 |
commit | 5e9d8657675a79b17f00e625749214e79bf116a1 (patch) | |
tree | 4a4840cbb32eb09877a6f5c5b0443011b03224bb | |
parent | 90c6dfa16cff8a70f27a867c3d97f6968384f755 (diff) | |
download | toybox-5e9d8657675a79b17f00e625749214e79bf116a1.tar.gz |
Fix invalid free in toysh.
-rw-r--r-- | toys/posix/sh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/sh.c b/toys/posix/sh.c index 32d05ec2..2f09f63b 100644 --- a/toys/posix/sh.c +++ b/toys/posix/sh.c @@ -305,7 +305,7 @@ static void run_pipeline(struct pipeline *line) tl->toy_main(); } cmd->pid = toys.exitval; - free(toys.optargs); + if (toys.optargs != toys.argv+1) free(toys.optargs); if (toys.old_umask) umask(toys.old_umask); memcpy(&toys, &temp, sizeof(struct toy_context)); } else { |