[svn-commits] mjordan: branch 10 r361754 - in /branches/10: ./ funcs/func_curl.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Apr 9 16:44:34 CDT 2012


Author: mjordan
Date: Mon Apr  9 16:44:30 2012
New Revision: 361754

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361754
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

Modified:
    branches/10/   (props changed)
    branches/10/funcs/func_curl.c

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

Modified: branches/10/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/funcs/func_curl.c?view=diff&rev=361754&r1=361753&r2=361754
==============================================================================
--- branches/10/funcs/func_curl.c (original)
+++ branches/10/funcs/func_curl.c Mon Apr  9 16:44:30 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 svn-commits mailing list