From: Sean Bright Date: Sun, 24 Jan 2010 21:49:17 +0000 (+0000) Subject: Instead of crashing, allocate our header ast_str before we try to use it. X-Git-Tag: 11.0.0-beta1~3541 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f356343dd9dd0a62737495c16a53cdbcbdb1a35;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/trunk@242607 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c index ff3046bf5c..91268a5088 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));