From a5c4fc7c5c66f3eb7033dfe9bab13f372f420312 Mon Sep 17 00:00:00 2001 From: dvossel Date: Thu, 18 Jun 2009 16:44:37 +0000 Subject: Merged revisions 201678 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r201678 | dvossel | 2009-06-18 11:37:42 -0500 (Thu, 18 Jun 2009) | 11 lines fixes some memory leaks and redundant conditions (closes issue #15269) Reported by: contactmayankjain Patches: patch.txt uploaded by contactmayankjain (license 740) memory_leak_stuff.trunk.diff uploaded by dvossel (license 671) Tested by: contactmayankjain, dvossel ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@201679 f38db490-d61c-443f-a65b-d21fe96a405b --- main/ast_expr2f.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'main/ast_expr2f.c') diff --git a/main/ast_expr2f.c b/main/ast_expr2f.c index 7c8d2f824..15020a60c 100644 --- a/main/ast_expr2f.c +++ b/main/ast_expr2f.c @@ -2379,7 +2379,7 @@ int ast_yyerror(const char *, YYLTYPE *, struct parse_io *); /* likewise */ void ast_yyfree(void *ptr, yyscan_t yyscanner) { - if (ptr) /* the normal generated ast_yyfree func just frees its first arg; + /* the normal generated ast_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 ); @@ -2416,8 +2416,7 @@ int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan) else buf[0] = 0; return_value = strlen(buf); - if (io.val->u.s) - free(io.val->u.s); + free(io.val->u.s); } free(io.val); } -- cgit v1.2.3