summaryrefslogtreecommitdiff
path: root/main/ast_expr2.fl
diff options
context:
space:
mode:
Diffstat (limited to 'main/ast_expr2.fl')
-rw-r--r--main/ast_expr2.fl9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl
index 575313b66..723eebf5a 100644
--- a/main/ast_expr2.fl
+++ b/main/ast_expr2.fl
@@ -121,6 +121,7 @@ static char *expr2_token_subst(const char *mess);
%option bison-bridge
%option bison-locations
%option noyywrap
+%option noyyfree
%x var trail
%%
@@ -236,6 +237,14 @@ static char *expr2_token_subst(const char *mess);
int ast_yyparse(void *); /* need to/should define this prototype for the call to yyparse */
int ast_yyerror(const char *, YYLTYPE *, struct parse_io *); /* likewise */
+void ast_yyfree(void *ptr, yyscan_t yyscanner)
+{
+ if (ptr) /* the normal generated yyfree func just frees its first arg;
+ this get complaints on some systems, as sometimes this
+ arg is a nil ptr! It's usually not fatal, but is irritating! */
+ free( (char *) ptr );
+}
+
int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
{
struct parse_io io;