[asterisk-commits] mjordan: branch 1.8 r361753 - /branches/1.8/funcs/func_curl.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 9 16:44:07 CDT 2012
Author: mjordan
Date: Mon Apr 9 16:44:03 2012
New Revision: 361753
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361753
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.
Modified:
branches/1.8/funcs/func_curl.c
Modified: branches/1.8/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_curl.c?view=diff&rev=361753&r1=361752&r2=361753
==============================================================================
--- branches/1.8/funcs/func_curl.c (original)
+++ branches/1.8/funcs/func_curl.c Mon Apr 9 16:44:03 2012
@@ -287,6 +287,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