aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-25 21:45:32 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-25 21:45:32 +0000
commitf3774a8d278cdc5a53cd6eb28d951d42906f6f8e (patch)
treec977115836ade6d6916eaa7733e48bc44ad7a18a
parente3e7d167a5912632cd9f363b88c814fd404e2523 (diff)
fixes a few redundant conditions
(issue #15269) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203444 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/ast_expr2.c1
-rw-r--r--main/ast_expr2.fl11
2 files changed, 5 insertions, 7 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index d9abfc10f..4dcda2e3b 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -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)
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl
index 98d2ea5c4..c47bdced9 100644
--- a/main/ast_expr2.fl
+++ b/main/ast_expr2.fl
@@ -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);
}