[asterisk-commits] mjordan: trunk r361755 - in /trunk: ./ funcs/func_curl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 9 16:47:57 CDT 2012


Author: mjordan
Date: Mon Apr  9 16:47:54 2012
New Revision: 361755

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361755
Log:
Allow func_curl to exit gracefully if list allocation fails during write

If the global_curl_info data structure could not be allocated, the
datastore associated with the operation would be free'd, but the function
would not return.  This would later dereference the datastore, almost
certainly causing Asterisk to crash.  With this patch, if the data
structure is not allocated the method will return an error code, and
not attempt any further operation.
........

Merged revisions 361753 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 361754 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/funcs/func_curl.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_curl.c?view=diff&rev=361755&r1=361754&r2=361755
==============================================================================
--- trunk/funcs/func_curl.c (original)
+++ trunk/funcs/func_curl.c Mon Apr  9 16:47:54 2012
@@ -302,6 +302,7 @@
 			if (!(list = ast_calloc(1, sizeof(*list)))) {
 				ast_log(LOG_ERROR, "Unable to allocate list head.  Cannot set any CURL options\n");
 				ast_datastore_free(store);
+				return -1;
 			}
 
 			store->data = list;




More information about the asterisk-commits mailing list