aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_phoneprov.c
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-24 21:49:17 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-24 21:49:17 +0000
commite9e6d14932447cf2767a8abdae04eef0017f3d8a (patch)
tree514ffe153b5b5135bb3dd4d269a012d0d2df4954 /res/res_phoneprov.c
parent8b4dc27865a83177995b10be7a0cb0f8bf966dca (diff)
Instead of crashing, allocate our header ast_str before we try to use it.
(closes issue #16680) Reported by: lmadsen Patches: issue16680_20100122.patch uploaded by seanbright (license 71) Tested by: lmadsen git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242607 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_phoneprov.c')
-rw-r--r--res/res_phoneprov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c
index ff3046bf5..91268a508 100644
--- a/res/res_phoneprov.c
+++ b/res/res_phoneprov.c
@@ -514,6 +514,7 @@ static int phoneprov_callback(struct ast_tcptls_session_instance *ser, const str
ast_free(file);
}
+ http_header = ast_str_create(80);
ast_str_set(&http_header, 0, "Content-type: %s\r\n",
route->file->mime_type);
@@ -522,6 +523,7 @@ static int phoneprov_callback(struct ast_tcptls_session_instance *ser, const str
if (tmp) {
ast_free(tmp);
}
+ ast_free(http_header);
goto out500;
}
ast_str_append(&result, 0, "%s", ast_str_buffer(tmp));