diff --git a/coreapi/chat.c b/coreapi/chat.c
index 076ff1489424b50cd2c4bcc244f179ba1274e4b2..86005269e526ff86ae95e6a58289127ec4ad4411 100644
--- a/coreapi/chat.c
+++ b/coreapi/chat.c
@@ -114,6 +114,9 @@ BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneChatMessage);
 
 static void _linphone_chat_room_destroy(LinphoneChatRoom *cr) {
 	bctbx_list_free_with_data(cr->transient_messages, (void (*)(void *))linphone_chat_message_release);
+	if (cr->received_rtt_characters) {
+		cr->received_rtt_characters = bctbx_list_free_with_data(cr->received_rtt_characters, (void (*)(void *))ms_free);
+	}
 	linphone_chat_room_delete_composing_idle_timer(cr);
 	linphone_chat_room_delete_composing_refresh_timer(cr);
 	linphone_chat_room_delete_remote_composing_refresh_timer(cr);
@@ -292,9 +295,6 @@ static void linphone_chat_room_delete_remote_composing_refresh_timer(LinphoneCha
 }
 
 void linphone_chat_room_destroy(LinphoneChatRoom *cr) {
-	if (cr->received_rtt_characters) {
-		cr->received_rtt_characters = bctbx_list_free(cr->received_rtt_characters);
-	}
 	linphone_chat_room_unref(cr);
 }
 
@@ -969,7 +969,7 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c
 			linphone_chat_room_message_received(cr, lc, msg);
 			linphone_chat_message_unref(msg);
 			cr->pending_message = NULL;
-			cr->received_rtt_characters = bctbx_list_free(cr->received_rtt_characters);
+			cr->received_rtt_characters = bctbx_list_free_with_data(cr->received_rtt_characters, (void (*)(void *))ms_free);
 		} else {
 			char *value = utf8_to_char(character);
 			cr->pending_message->message = ms_strcat_printf(cr->pending_message->message, value);
diff --git a/tester/message_tester.c b/tester/message_tester.c
index a00e79710c3b04165413c520d07f2a6c0d808896..1e32f2b105f5bf3165bd6d1e831c40b9de4275d7 100644
--- a/tester/message_tester.c
+++ b/tester/message_tester.c
@@ -1593,6 +1593,10 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo
 	}
 
 	if (srtp_enabled) {
+		if (!ms_srtp_supported()) {
+			ms_warning("test skipped, missing srtp support");
+			goto srtp_end;
+		}
 		BC_ASSERT_TRUE(linphone_core_media_encryption_supported(marie->lc, LinphoneMediaEncryptionSRTP));
 		linphone_core_set_media_encryption(marie->lc, LinphoneMediaEncryptionSRTP);
 		linphone_core_set_media_encryption(pauline->lc, LinphoneMediaEncryptionSRTP);
@@ -1672,6 +1676,7 @@ end:
 		end_call(marie, pauline);
 	}
 	linphone_call_params_destroy(marie_params);
+srtp_end:
 	linphone_core_manager_destroy(marie);
 	linphone_core_manager_destroy(pauline);
 	remove(marie_db);