From f02dbf98aec7c6d83f8cea3e34cbd36dcbb5cc0a Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <ronan.abhamon@belledonne-communications.com>
Date: Tue, 4 Sep 2018 13:54:17 +0200
Subject: [PATCH] fix(c-chat-message): avoid memory leak in wrapper when
 linphone_chat_message_get_participants_by_imdn_state is called

---
 include/linphone/api/c-chat-message.h | 7 +++++--
 src/c-wrapper/api/c-chat-message.cpp  | 4 +++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/linphone/api/c-chat-message.h b/include/linphone/api/c-chat-message.h
index 431815c635..0f47383200 100644
--- a/include/linphone/api/c-chat-message.h
+++ b/include/linphone/api/c-chat-message.h
@@ -416,9 +416,12 @@ LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer_in_progress (Linph
  * @param[in] msg #LinphoneChatMessage object.
  * @param[in] state The LinphoneChatMessageState the imdn have reached (only use LinphoneChatMessageStateDelivered,
  * LinphoneChatMessageStateDeliveredToUser, LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)
- * @return \bctbx_list{LinphoneParticipantImdnState}
+ * @return \bctbx_list{LinphoneParticipantImdnState} \onTheFlyList
  */
-LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_by_imdn_state (const LinphoneChatMessage *msg, LinphoneChatMessageState state);
+LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_by_imdn_state (
+	const LinphoneChatMessage *msg,
+	LinphoneChatMessageState state
+);
 
 /**
  * @}
diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp
index aa260fee00..3ed7781edd 100644
--- a/src/c-wrapper/api/c-chat-message.cpp
+++ b/src/c-wrapper/api/c-chat-message.cpp
@@ -271,7 +271,9 @@ bool_t linphone_chat_message_is_file_transfer_in_progress (LinphoneChatMessage *
 }
 
 bctbx_list_t *linphone_chat_message_get_participants_by_imdn_state (const LinphoneChatMessage *msg, LinphoneChatMessageState state) {
-	return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(msg)->getParticipantsByImdnState(LinphonePrivate::ChatMessage::State(state)));
+	return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(
+		L_GET_CPP_PTR_FROM_C_OBJECT(msg)->getParticipantsByImdnState(LinphonePrivate::ChatMessage::State(state))
+	);
 }
 
 bool_t linphone_chat_message_download_content (LinphoneChatMessage *msg, LinphoneContent *c_content) {
-- 
GitLab