Mercurial > hg > toybox
changeset 777:85e5097c49c1
Fix invalid free in toysh.
author | Felix Janda <felix.janda@posteo.de> |
---|---|
date | Sun, 30 Dec 2012 11:53:27 +0100 |
parents | cf101d432225 |
children | 14aabcd31fd9 |
files | toys/posix/sh.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/posix/sh.c Sun Dec 30 04:43:11 2012 -0600 +++ b/toys/posix/sh.c Sun Dec 30 11:53:27 2012 +0100 @@ -305,7 +305,7 @@ 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 {