fix attempt to free pointer to stack (function-local storage)
discovered by Elias Pipping patch by Jared Yanovich alloc/afree checker by Todd C. Miller
This commit is contained in:
7
syn.c
7
syn.c
@ -2,7 +2,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.23 2008/07/12 16:56:40 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.24 2008/07/14 12:29:06 tg Exp $");
|
||||
|
||||
struct nesting_state {
|
||||
int start_token; /* token than began nesting (eg, FOR) */
|
||||
@ -411,6 +411,11 @@ get_command(int cf)
|
||||
case TIME:
|
||||
syniocf &= ~(KEYWORD|ALIAS);
|
||||
t = pipeline(0);
|
||||
if (t) {
|
||||
t->str = alloc(2, ATEMP);
|
||||
t->str[0] = 0; /* TF_* flags */
|
||||
t->str[1] = '\0';
|
||||
}
|
||||
t = block(TTIME, t, NOBLOCK, NOWORDS);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user