From 7c3700c19036a6d8d20816545e64ee774381c537 Mon Sep 17 00:00:00 2001 From: axel Date: Thu, 9 Feb 2006 01:39:04 +1000 Subject: [PATCH] Fix crash bug caused by trying to free halloc:ed memory darcs-hash:20060208153904-ac50b-f8b3d2aadb12fa1e6aca0c4ca7a6046a09a0450d.gz --- parser.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/parser.c b/parser.c index 09b48e400..d7b2c4772 100644 --- a/parser.c +++ b/parser.c @@ -2052,14 +2052,9 @@ static int parse_job( process_t *p, if( error_code ) { - /* - We don't know what the state of the args array and the argv - vector is on error, so we do an internal cleanup here. - */ - al_foreach( &args, - (void (*)(const void *))&free ); - free(p->argv); - p->argv=0; + if( !p->argv ) + al_foreach( &args, + (void (*)(const void *))&free ); /* Make sure the block stack is consistent */