fix dereferencing freed memory

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-05-01 00:02:12 +00:00
parent 595955ea98
commit 2c2f7e817b
2 changed files with 54 additions and 52 deletions

View File

@@ -569,12 +569,13 @@ macro_call : word LP {reset_argcount(parseio->scanner);} eval_arglist RP {
*/
application_call_head: word LP {reset_argcount(parseio->scanner);} {
if (strcasecmp($1,"goto") == 0) {
$$= npval2(PV_GOTO, &@1, &@3);
$$ = npval2(PV_GOTO, &@1, &@2);
free($1); /* won't be using this */
ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Suggestion: Use the goto statement instead of the Goto() application call in AEL.\n", my_file, @1.first_line, @1.first_column, @1.last_column );
} else
$$= npval2(PV_APPLICATION_CALL, &@1, &@3);
$$->u1.str = $1; }
} else {
$$= npval2(PV_APPLICATION_CALL, &@1, &@2);
$$->u1.str = $1;
} }
;
application_call : application_call_head eval_arglist RP {