From 70f9617b508d3548b7d8caaa95ed7adfcea33aca Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 12 Dec 2013 17:25:15 +0100 Subject: [PATCH] minor changes --- coreapi/bellesip_sal/sal_op_presence.c | 2 -- coreapi/presence.c | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_presence.c b/coreapi/bellesip_sal/sal_op_presence.c index 2e6ea3fcd..9f7d6f871 100644 --- a/coreapi/bellesip_sal/sal_op_presence.c +++ b/coreapi/bellesip_sal/sal_op_presence.c @@ -44,8 +44,6 @@ void sal_add_presence_info(SalOp *op, belle_sip_message_t *notify, SalPresenceMo belle_sip_message_set_body(BELLE_SIP_MESSAGE(notify),content,content_length); ms_free(content); } - - } static void presence_process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){ diff --git a/coreapi/presence.c b/coreapi/presence.c index e4cd069b9..3d50548bb 100644 --- a/coreapi/presence.c +++ b/coreapi/presence.c @@ -1896,7 +1896,7 @@ void linphone_notify_convert_presence_to_xml(SalOp *op, SalPresenceModel *presen if ((model == NULL) || (model->services == NULL)) { err = write_xml_presence_service(writer, NULL, contact); } else { - struct _presence_service_obj_st st; + struct _presence_service_obj_st st={0}; st.writer = writer; st.contact = contact; st.err = &err; @@ -1904,13 +1904,13 @@ void linphone_notify_convert_presence_to_xml(SalOp *op, SalPresenceModel *presen } } if ((err >= 0) && (model != NULL)) { - struct _presence_person_obj_st st; + struct _presence_person_obj_st st={0}; st.writer = writer; st.err = &err; ms_list_for_each2(model->persons, (MSIterate2Func)write_xml_presence_person_obj, &st); } if ((err >= 0) && (model != NULL)) { - struct _presence_note_obj_st st; + struct _presence_note_obj_st st={0}; st.writer = writer; st.ns = NULL; st.err = &err; @@ -1923,12 +1923,11 @@ void linphone_notify_convert_presence_to_xml(SalOp *op, SalPresenceModel *presen if (err >= 0) { err = xmlTextWriterEndDocument(writer); } - - xmlFreeTextWriter(writer); if (err > 0) { /* xmlTextWriterEndDocument returns the size of the content. */ *content = ms_strdup((char *)buf->content); } + xmlFreeTextWriter(writer); xmlBufferFree(buf); }