mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 01:28:42 +00:00
silly rabbit, leaks are for kids.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7846 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4a132c95a5
commit
2e0e95fa97
@ -73,6 +73,8 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
|
|||||||
uint32_t cur_try;
|
uint32_t cur_try;
|
||||||
long httpRes;
|
long httpRes;
|
||||||
CURL *curl_handle = NULL;
|
CURL *curl_handle = NULL;
|
||||||
|
struct curl_slist *headers = NULL;
|
||||||
|
struct curl_slist *slist = NULL;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
@ -121,8 +123,6 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
|
|||||||
|
|
||||||
/* try to post it to the web server */
|
/* try to post it to the web server */
|
||||||
if (!switch_strlen_zero(globals.url)) {
|
if (!switch_strlen_zero(globals.url)) {
|
||||||
struct curl_slist *headers = NULL;
|
|
||||||
struct curl_slist *slist = NULL;
|
|
||||||
curl_handle = curl_easy_init();
|
curl_handle = curl_easy_init();
|
||||||
|
|
||||||
if (globals.encode) {
|
if (globals.encode) {
|
||||||
@ -189,6 +189,9 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
|
|||||||
}
|
}
|
||||||
curl_easy_cleanup(curl_handle);
|
curl_easy_cleanup(curl_handle);
|
||||||
curl_slist_free_all(headers);
|
curl_slist_free_all(headers);
|
||||||
|
curl_slist_free_all(slist);
|
||||||
|
slist = NULL;
|
||||||
|
headers = NULL;
|
||||||
curl_handle = NULL;
|
curl_handle = NULL;
|
||||||
|
|
||||||
/* if we are here the web post failed for some reason */
|
/* if we are here the web post failed for some reason */
|
||||||
@ -222,6 +225,12 @@ error:
|
|||||||
if (curl_handle) {
|
if (curl_handle) {
|
||||||
curl_easy_cleanup(curl_handle);
|
curl_easy_cleanup(curl_handle);
|
||||||
}
|
}
|
||||||
|
if (headers) {
|
||||||
|
curl_slist_free_all(headers);
|
||||||
|
}
|
||||||
|
if (slist) {
|
||||||
|
curl_slist_free_all(slist);
|
||||||
|
}
|
||||||
switch_safe_free(curl_xml_text);
|
switch_safe_free(curl_xml_text);
|
||||||
switch_safe_free(xml_text);
|
switch_safe_free(xml_text);
|
||||||
switch_safe_free(path);
|
switch_safe_free(path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user