Fix memory leak of some strings extracted from XML documents.

This commit is contained in:
Ghislain MARY 2015-02-18 17:49:33 +01:00
parent 23ba230da6
commit 20a5c21ee7
2 changed files with 9 additions and 9 deletions

View file

@ -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);
}
}

View file

@ -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);