]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 203444 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Thu, 25 Jun 2009 21:46:46 +0000 (21:46 +0000)
committerDavid Vossel <dvossel@digium.com>
Thu, 25 Jun 2009 21:46:46 +0000 (21:46 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r203444 | dvossel | 2009-06-25 16:45:32 -0500 (Thu, 25 Jun 2009) | 4 lines

  fixes a few redundant conditions

  (issue #15269)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@203446 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/ast_expr2.c
main/ast_expr2.fl

index 068e47acd06427e78bca8a4bf9ce9f79d2eb4cde..44b0b7ece87e8f3d7c1ce4b8f2a6bb306c1c1be0 100644 (file)
@@ -2415,7 +2415,6 @@ static void
 free_value (struct val *vp)
 {      
        if (vp==NULL) {
-               free(vp);
                return;
        }
        if (vp->type == AST_EXPR_string || vp->type == AST_EXPR_numeric_string)
index 499706811f6a69e4a45cb59bbfa62718ab4a41c8..c2e39be0c1fd930dcb5616745c1e7bf292edac46 100644 (file)
@@ -243,10 +243,10 @@ 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 );
+    /* 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)
@@ -287,8 +287,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);
        }