diff --git a/coreapi/bellesip_sal/sal_op_publish.c b/coreapi/bellesip_sal/sal_op_publish.c index d5c16ff66..a525a9998 100644 --- a/coreapi/bellesip_sal/sal_op_publish.c +++ b/coreapi/bellesip_sal/sal_op_publish.c @@ -32,7 +32,7 @@ static void publish_refresher_listener (belle_sip_refresher_t* refresher }else if (status_code>=200){ belle_sip_header_t *sip_etag; const char *sip_etag_string = NULL; - if ((sip_etag = belle_sip_message_get_header(BELLE_SIP_MESSAGE(response), "SIP-ETag"))) { + if (response && (sip_etag = belle_sip_message_get_header(BELLE_SIP_MESSAGE(response), "SIP-ETag"))) { sip_etag_string = belle_sip_header_get_unparsed_value(sip_etag); } sal_op_set_entity_tag(op, sip_etag_string); diff --git a/coreapi/presence.c b/coreapi/presence.c index b4d46f934..bb0694522 100644 --- a/coreapi/presence.c +++ b/coreapi/presence.c @@ -1460,7 +1460,7 @@ static LinphonePresenceModel * process_pidf_xml_presence_notification(xmlparsing void linphone_core_add_subscriber(LinphoneCore *lc, const char *subscriber, SalOp *op){ - LinphoneFriend *fl=linphone_friend_new_with_address(subscriber); + LinphoneFriend *fl=linphone_core_create_friend_with_address(lc,subscriber); char *tmp; if (fl==NULL) return ;