[asterisk-commits] seanbright: trunk r242607 - /trunk/res/res_phoneprov.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 24 15:49:21 CST 2010


Author: seanbright
Date: Sun Jan 24 15:49:17 2010
New Revision: 242607

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242607
Log:
Instead of crashing, allocate our header ast_str before we try to use it.

Reported by: lmadsen
Patches:
      issue16680_20100122.patch uploaded by seanbright (license 71)
Tested by: lmadsen

Modified:
    trunk/res/res_phoneprov.c

Modified: trunk/res/res_phoneprov.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_phoneprov.c?view=diff&rev=242607&r1=242606&r2=242607
==============================================================================
--- trunk/res/res_phoneprov.c (original)
+++ trunk/res/res_phoneprov.c Sun Jan 24 15:49:17 2010
@@ -514,6 +514,7 @@
 			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 @@
 			if (tmp) {
 				ast_free(tmp);
 			}
+			ast_free(http_header);
 			goto out500;
 		}
 		ast_str_append(&result, 0, "%s", ast_str_buffer(tmp)); 




More information about the asterisk-commits mailing list