aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-18 16:51:54 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-18 16:51:54 +0000
commitf789484094473a3914d3cd4d99ea8950e32c15ef (patch)
tree1f8b8565fdaccde4115c617c6c1381ab56ad4dca /utils
parent0816d31618f6656fcdd348220f863a1635716bc4 (diff)
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.1@201680 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils')
-rw-r--r--utils/ael_main.c3
-rw-r--r--utils/conf2ael.c3
-rw-r--r--utils/extconf.c3
-rw-r--r--utils/stereorize.c3
4 files changed, 7 insertions, 5 deletions
diff --git a/utils/ael_main.c b/utils/ael_main.c
index ba7970955..9249cd77b 100644
--- a/utils/ael_main.c
+++ b/utils/ael_main.c
@@ -299,8 +299,7 @@ int ast_add_extension2(struct ast_context *con,
}
/* since add_extension2 is responsible for the malloc'd data stuff */
- if( data )
- free(data);
+ free(data);
return 0;
}
diff --git a/utils/conf2ael.c b/utils/conf2ael.c
index e0711808b..3b15336c3 100644
--- a/utils/conf2ael.c
+++ b/utils/conf2ael.c
@@ -471,7 +471,7 @@ int main(int argc, char **argv)
if (mon) {
*mon++ = 0;
/* now all 4 fields are set; what do we do? */
- pvalIncludesAddIncludeWithTimeConstraints(incl, all, hr, dow, dom, mon);
+ pvalIncludesAddIncludeWithTimeConstraints(incl, strdup(all), strdup(hr), strdup(dow), strdup(dom), strdup(mon));
/* the original data is always best to keep (no 2-min rounding) */
} else {
ast_log(LOG_ERROR,"No month spec attached to include!\n");
@@ -483,6 +483,7 @@ int main(int argc, char **argv)
ast_log(LOG_ERROR,"No day of week spec attached to include!\n");
}
}
+ free(all);
}
tmpi = tmpi->next;
}
diff --git a/utils/extconf.c b/utils/extconf.c
index ebb2220a0..7f2d68196 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -2993,8 +2993,7 @@ static struct ast_var_t *ast_var_assign(const char *name, const char *value)
static void ast_var_delete(struct ast_var_t *var)
{
- if (var)
- free(var);
+ free(var);
}
diff --git a/utils/stereorize.c b/utils/stereorize.c
index c8428320d..31f1b1fbe 100644
--- a/utils/stereorize.c
+++ b/utils/stereorize.c
@@ -156,4 +156,7 @@ int main( int argcount, char *args[])
}
}
/* That was an endless loop. This point is never reached. */
+ free(leftsample);
+ free(rightsample);
+ free(stereosample);
}