[asterisk-commits] tilghman: branch 1.2 r46662 - /branches/1.2/apps/app_curl.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Oct 31 08:46:04 MST 2006


Author: tilghman
Date: Tue Oct 31 09:46:04 2006
New Revision: 46662

URL: http://svn.digium.com/view/asterisk?rev=46662&view=rev
Log:
Move thread-unsafe initializer to the module loading code; add the
corresponding function to the module unload to fix a memory leak.

Modified:
    branches/1.2/apps/app_curl.c

Modified: branches/1.2/apps/app_curl.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_curl.c?rev=46662&r1=46661&r2=46662&view=diff
==============================================================================
--- branches/1.2/apps/app_curl.c (original)
+++ branches/1.2/apps/app_curl.c Tue Oct 31 09:46:04 2006
@@ -94,7 +94,6 @@
 {
 	CURL *curl;
 
-	curl_global_init(CURL_GLOBAL_ALL);
 	curl = curl_easy_init();
 
 	if (!curl) {
@@ -224,6 +223,7 @@
 	res |= ast_unregister_application(app);
 
 	STANDARD_HANGUP_LOCALUSERS;
+	curl_global_cleanup();
 	
 	return res;
 }
@@ -232,6 +232,7 @@
 {
 	int res;
 
+	curl_global_init(CURL_GLOBAL_ALL);
 	res = ast_custom_function_register(&acf_curl);
 	res |= ast_register_application(app, curl_exec, synopsis, descrip);
 



More information about the asterisk-commits mailing list