summaryrefslogtreecommitdiff
path: root/res/res_http_post.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-08-04 16:34:04 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-08-04 16:34:04 +0000
commitaca394bf0cea646cc78c5e0e8a72cc5d1f21452b (patch)
treece28b1d11d703a473e36dcd37364126ff39daaed /res/res_http_post.c
parentb73b6b53cd57417faa73a78cfd20748092b0a5bd (diff)
HTTP module memory leaks
(closes issue #13230) Reported by: eliel Patches: res_http_post_leak.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_http_post.c')
-rw-r--r--res/res_http_post.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/res/res_http_post.c b/res/res_http_post.c
index f1ae7a7da..2e4a20a1d 100644
--- a/res/res_http_post.c
+++ b/res/res_http_post.c
@@ -289,12 +289,15 @@ static int __ast_http_post_load(int reload)
struct ast_str *ds;
if (!(urih = ast_calloc(sizeof(*urih), 1))) {
+ ast_config_destroy(cfg);
return -1;
}
- if (!(ds = ast_str_create(32)))
+ if (!(ds = ast_str_create(32))) {
+ ast_free(urih);
+ ast_config_destroy(cfg);
return -1;
-
+ }
urih->description = ast_strdup("HTTP POST mapping");
urih->uri = ast_strdup(v->name);
@@ -305,6 +308,7 @@ static int __ast_http_post_load(int reload)
urih->supports_post = 1;
urih->callback = http_post_callback;
urih->key = __FILE__;
+ urih->mallocd = urih->dmallocd = 1;
ast_http_uri_link(urih);
}
@@ -323,7 +327,6 @@ static int unload_module(void)
static int reload(void)
{
-
__ast_http_post_load(1);
return AST_MODULE_LOAD_SUCCESS;