Commit f7ae768d authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix memory leak in log collection.

parent 08beaa9b
......@@ -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 {
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment