]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10440: [mod_httapi] valgrind: event leak in mod_httapi.c #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 29 Jun 2017 23:21:23 +0000 (18:21 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 29 Jun 2017 23:21:23 +0000 (18:21 -0500)
src/mod/applications/mod_httapi/mod_httapi.c

index 96c8089c157505cd0b214e41170da4361579b635..0b15ec5d7debf9f8902f0dfd7dbfc430a97ec596 100644 (file)
@@ -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);