From f7ae768d3e8a1e240cf0aaae55cdd3e7d4d7dba7 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 10 Mar 2016 16:26:54 +0100 Subject: [PATCH] Fix memory leak in log collection. --- coreapi/linphonecore.c | 2 ++ tester/log_collection_tester.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 28b3bf9e1..f48ae05fc 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -531,6 +531,7 @@ static void process_response_from_post_file_log_collection(void *data, const bel cbs.process_io_error = process_io_error_upload_log_collection; cbs.process_auth_requested = process_auth_requested_upload_log_collection; l = belle_http_request_listener_create_from_callbacks(&cbs, core); + belle_sip_object_data_set(BELLE_SIP_OBJECT(req), "http_request_listener", l, belle_sip_object_unref); // Ensure the listener object is destroyed when the request is destroyed belle_http_provider_send_request(core->http_provider, req, l); } if (code == 200) { /* The file has been uploaded correctly, get the server reply */ @@ -683,6 +684,7 @@ void linphone_core_upload_log_collection(LinphoneCore *core) { cbs.process_io_error = process_io_error_upload_log_collection; cbs.process_auth_requested = process_auth_requested_upload_log_collection; l = belle_http_request_listener_create_from_callbacks(&cbs, core); + belle_sip_object_data_set(BELLE_SIP_OBJECT(req), "http_request_listener", l, belle_sip_object_unref); // Ensure the listener object is destroyed when the request is destroyed belle_http_provider_send_request(core->http_provider, req, l); ms_free(name); } else { diff --git a/tester/log_collection_tester.c b/tester/log_collection_tester.c index 11463424e..a18c90e69 100644 --- a/tester/log_collection_tester.c +++ b/tester/log_collection_tester.c @@ -321,7 +321,7 @@ test_t log_collection_tests[] = { TEST_NO_TAG("Collect files filled when enabled", collect_files_filled), TEST_NO_TAG("Logs collected into small file", collect_files_small_size), TEST_NO_TAG("Logs collected when decreasing max size", collect_files_changing_size), - TEST_ONE_TAG("Upload collected traces", upload_collected_traces, "MemoryLeaks") + TEST_NO_TAG("Upload collected traces", upload_collected_traces) }; test_suite_t log_collection_test_suite = {"LogCollection", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,