[asterisk-commits] twilson: branch group/manager_http_auth r162081 - /team/group/manager_http_au...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 9 11:32:41 CST 2008


Author: twilson
Date: Tue Dec  9 11:32:41 2008
New Revision: 162081

URL: http://svn.digium.com/view/asterisk?view=rev&rev=162081
Log:
Add check for failure to allocate string

Modified:
    team/group/manager_http_auth/res/res_phoneprov.c

Modified: team/group/manager_http_auth/res/res_phoneprov.c
URL: http://svn.digium.com/view/asterisk/team/group/manager_http_auth/res/res_phoneprov.c?view=diff&rev=162081&r1=162080&r2=162081
==============================================================================
--- team/group/manager_http_auth/res/res_phoneprov.c (original)
+++ team/group/manager_http_auth/res/res_phoneprov.c Tue Dec  9 11:32:41 2008
@@ -484,7 +484,13 @@
 		ast_str_set(&http_header, 0, "Content-type: %s\r\n",
 			route->file->mime_type);
 
-		result = ast_str_create(512);
+		if (!(result = ast_str_create(512))) {
+			ast_log(LOG_ERROR, "Could not create result string!\n");
+			if (tmp) {
+				ast_free(tmp);
+			}
+			goto out500;
+		}
 		ast_str_append(&result, 0, "%s", tmp); 
 
 		ast_http_send(ser, method, 200, NULL, http_header, result, 0, 0);




More information about the asterisk-commits mailing list