Fixed leak of LinphoneContent

This commit is contained in:
Sylvain Berfini 2018-03-20 11:44:53 +01:00
parent fa37a0cd50
commit 472f010e81
2 changed files with 2 additions and 1 deletions

View file

@ -291,7 +291,7 @@ int linphone_chat_message_set_text(LinphoneChatMessage *msg, const char* text) {
LinphoneContent *linphone_chat_message_get_file_transfer_information(LinphoneChatMessage *msg) {
const LinphonePrivate::Content *content = L_GET_PRIVATE_FROM_C_OBJECT(msg)->getFileTransferInformation();
if (content) return linphone_content_ref(L_GET_C_BACK_PTR(content));
if (content) return L_GET_C_BACK_PTR(content);
return NULL;
}

View file

@ -723,6 +723,7 @@ void FileTransferChatMessageModifier::onRecvBody (belle_sip_user_body_handler_t
// Legacy: call back given by application level
linphone_core_notify_file_transfer_recv(message->getCore()->getCCore(), msg, content, (const char *)buffer, size);
}
linphone_content_unref(content);
}
} else {
lWarning() << "File transfer decrypt failed with code " << (int)retval;