From ae5c1978089c2a47b14b0048e29c21d0b4202e6b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 29 Jun 2017 18:21:23 -0500 Subject: [PATCH] FS-10440: [mod_httapi] valgrind: event leak in mod_httapi.c #resolve --- src/mod/applications/mod_httapi/mod_httapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index 96c8089c15..0b15ec5d7d 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);