From: Anthony Minessale Date: Thu, 29 Jun 2017 23:21:23 +0000 (-0500) Subject: FS-10440: [mod_httapi] valgrind: event leak in mod_httapi.c #resolve X-Git-Tag: v1.6.19~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaf86d8bb6be138dd2c6851f1e5ac0c7001b4097;p=thirdparty%2Ffreeswitch.git FS-10440: [mod_httapi] valgrind: event leak in mod_httapi.c #resolve --- diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index b97b7f62eb..517567357b 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -2603,7 +2603,9 @@ static switch_status_t fetch_cache_data(http_file_context_t *context, const char } if (headers) { - switch_event_create(&client->headers, SWITCH_EVENT_CLONE); + if (!client->headers) { + switch_event_create(&client->headers, SWITCH_EVENT_CLONE); + } if (save_path) { switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, get_header_callback); switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, (void *) client);