From 0dfe68b2c5adfd34af8c84d99cc60452a285d557 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 27 Jun 2016 15:34:09 +0200 Subject: [PATCH] Fix issue in chatdb unlink in tester + use delete instead of free --- coreapi/vcard.cc | 6 +++--- tester/tester.c | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/coreapi/vcard.cc b/coreapi/vcard.cc index aea982ebd..e85948582 100644 --- a/coreapi/vcard.cc +++ b/coreapi/vcard.cc @@ -65,7 +65,7 @@ bctbx_list_t* linphone_vcard_list_from_vcard4_file(const char *filename) { result = bctbx_list_append(result, vCard); } } - free(parser); + delete(parser); } return result; } @@ -82,7 +82,7 @@ bctbx_list_t* linphone_vcard_list_from_vcard4_buffer(const char *buffer) { result = bctbx_list_append(result, vCard); } } - free(parser); + delete(parser); } return result; } @@ -97,7 +97,7 @@ LinphoneVcard* linphone_vcard_new_from_vcard4_buffer(const char *buffer) { } else { ms_error("Couldn't parse buffer %s", buffer); } - free(parser); + delete(parser); } return vCard; } diff --git a/tester/tester.c b/tester/tester.c index 2a8544bac..0c865fce5 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -420,7 +420,7 @@ void linphone_core_manager_uninit(LinphoneCoreManager *mgr) { if (mgr->stat.last_received_info_message) linphone_info_message_destroy(mgr->stat.last_received_info_message); if (mgr->lc){ const char *record_file=linphone_core_get_record_file(mgr->lc); - const char *chatdb = linphone_core_get_chat_database_path(mgr->lc); + char *chatdb = ms_strdup(linphone_core_get_chat_database_path(mgr->lc)); if (!liblinphone_tester_keep_record_files && record_file){ if ((bc_get_number_of_failures()-mgr->number_of_cunit_error_at_creation)>0) { ms_message ("Test has failed, keeping recorded file [%s]",record_file); @@ -429,7 +429,10 @@ void linphone_core_manager_uninit(LinphoneCoreManager *mgr) { } } linphone_core_destroy(mgr->lc); - if (chatdb) unlink(chatdb); + if (chatdb) { + unlink(chatdb); + ms_free(chatdb); + } } if (mgr->identity) { linphone_address_destroy(mgr->identity);