Commit 39b9fcd8 authored by jehan's avatar jehan
Browse files

protect chat message from being released in delivery error cb

parent 641e9fc7
...@@ -316,7 +316,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM ...@@ -316,7 +316,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM
char* content_type; char* content_type;
const char *identity=NULL; const char *identity=NULL;
time_t t=time(NULL); time_t t=time(NULL);
linphone_chat_message_ref(msg);
/* Check if we shall upload a file to a server */ /* Check if we shall upload a file to a server */
if (msg->file_transfer_information != NULL) { 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) */ /* 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 ...@@ -337,7 +337,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM
cbs.process_auth_requested=process_auth_requested; 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 */ 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); belle_http_provider_send_request(cr->lc->http_provider,req,l);
linphone_chat_message_unref(msg);
return; return;
} }
...@@ -388,6 +388,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM ...@@ -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_idle_timer(cr);
linphone_chat_room_delete_composing_refresh_timer(cr); linphone_chat_room_delete_composing_refresh_timer(cr);
linphone_chat_message_unref(msg);
} }
/** /**
......
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