From 39b9fcd8e7144814188ee0c67bd273221fd2ddad Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 1 Jul 2014 11:52:52 +0200 Subject: [PATCH] protect chat message from being released in delivery error cb --- coreapi/chat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 36f5beb89..c344d9771 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -316,7 +316,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM char* content_type; const char *identity=NULL; time_t t=time(NULL); - + linphone_chat_message_ref(msg); /* Check if we shall upload a file to a server */ if (msg->file_transfer_information != NULL) { /* open a transaction with the server and send an empty request(RCS5.1 section 3.5.4.8.3.1) */ @@ -337,7 +337,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM cbs.process_auth_requested=process_auth_requested; l=belle_http_request_listener_create_from_callbacks(&cbs,msg); /* give msg to listener to be able to start the actual file upload when server answer a 204 No content */ belle_http_provider_send_request(cr->lc->http_provider,req,l); - + linphone_chat_message_unref(msg); return; } @@ -388,6 +388,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM } linphone_chat_room_delete_composing_idle_timer(cr); linphone_chat_room_delete_composing_refresh_timer(cr); + linphone_chat_message_unref(msg); } /**