Commit 7b5061ac authored by Ghislain MARY's avatar Ghislain MARY

Fix memory leaks.

parent e2ca3cbb
......@@ -816,6 +816,7 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
} else {
/* swap encrypted message with plain text message */
linphone_chat_message_set_text(msg, (char *)decrypted_body);
ms_free(decrypted_body);
if (decrypted_content_type != NULL) {
linphone_chat_message_set_content_type(msg, decrypted_content_type);
ms_free(decrypted_content_type);
......@@ -870,6 +871,7 @@ int lime_im_encryption_engine_process_outgoing_message_cb(LinphoneImEncryptionEn
errcode = 488;
} else { /* encryption ok, swap plain text message body by encrypted one */
linphone_chat_message_set_text(msg, (char *)crypted_body);
ms_free(crypted_body);
linphone_chat_message_set_content_type(msg, new_content_type);
}
ms_free(peerUri);
......
......@@ -1114,7 +1114,6 @@ static void _im_error_delivery_notification(bool_t online) {
linphone_im_notif_policy_enable_all(linphone_core_get_im_notif_policy(pauline->lc));
msg = linphone_chat_room_create_message(chat_room, "Happy new year!");
linphone_chat_message_ref(msg);
cbs = linphone_chat_message_get_callbacks(msg);
linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed);
linphone_chat_room_send_chat_message(chat_room, msg);
......@@ -1131,7 +1130,6 @@ static void _im_error_delivery_notification(bool_t online) {
/* Restore the ZID cache of the receiver and resend the chat message */
linphone_core_set_zrtp_cache_db(marie->lc, zrtp_cache_db_holder);
linphone_chat_message_ref(msg);
linphone_chat_message_resend(msg);
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 2)); /* Check the new message is now received */
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &pauline->stat.number_of_LinphoneMessageDeliveredToUser, 1));
......
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