diff --git a/coreapi/chat.c b/coreapi/chat.c index 8d987417c..269af03e6 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -845,6 +845,10 @@ static void process_im_is_composing_notification(LinphoneChatRoom *cr, xmlparsin cr->remote_is_composing = state; linphone_core_notify_is_composing_received(cr->lc, cr); + linphone_free_xml_text_content(state_str); + } + if (refresh_str != NULL) { + linphone_free_xml_text_content(refresh_str); } } diff --git a/coreapi/presence.c b/coreapi/presence.c index 869f723ed..e944d3a45 100644 --- a/coreapi/presence.c +++ b/coreapi/presence.c @@ -1211,19 +1211,15 @@ static int process_pidf_xml_presence_services(xmlparsing_context_t *xml_ctx, Lin service_id_str = linphone_get_xml_text_content(xml_ctx, xpath_str); service = presence_service_new(service_id_str, basic_status); if (service != NULL) { - if (timestamp_str != NULL) { - presence_service_set_timestamp(service, parse_timestamp(timestamp_str)); - linphone_free_xml_text_content(timestamp_str); - } - if (contact_str != NULL) { - linphone_presence_service_set_contact(service, contact_str); - linphone_free_xml_text_content(contact_str); - } + if (timestamp_str != NULL) presence_service_set_timestamp(service, parse_timestamp(timestamp_str)); + if (contact_str != NULL) linphone_presence_service_set_contact(service, contact_str); process_pidf_xml_presence_service_notes(xml_ctx, service, i); linphone_presence_model_add_service(model, service); } - linphone_free_xml_text_content(basic_status_str); + if (timestamp_str != NULL) linphone_free_xml_text_content(timestamp_str); + if (contact_str != NULL) linphone_free_xml_text_content(contact_str); if (service_id_str != NULL) linphone_free_xml_text_content(service_id_str); + linphone_free_xml_text_content(basic_status_str); } } if (service_object != NULL) xmlXPathFreeObject(service_object);