From 054ecbbe901c207a776a0eb9c7e6cb0dc090875a Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 15 Oct 2013 09:32:16 +0200 Subject: [PATCH] fix crash in case of out of dialog NOTIFY rejected by application because unknown from --- coreapi/address.c | 3 ++- coreapi/bellesip_sal/sal_op_presence.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/address.c b/coreapi/address.c index cd2542808..bb50fe30a 100644 --- a/coreapi/address.c +++ b/coreapi/address.c @@ -32,7 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. **/ LinphoneAddress * linphone_address_new(const char *addr){ SalAddress *saddr=sal_address_new(addr); - if (saddr==NULL) ms_error("Cannot create LinphoneAddress, bad uri [%s]",addr); + if (saddr==NULL) + ms_error("Cannot create LinphoneAddress, bad uri [%s]",addr); return saddr; } diff --git a/coreapi/bellesip_sal/sal_op_presence.c b/coreapi/bellesip_sal/sal_op_presence.c index 836cc11c6..c7f548e18 100644 --- a/coreapi/bellesip_sal/sal_op_presence.c +++ b/coreapi/bellesip_sal/sal_op_presence.c @@ -201,8 +201,9 @@ static void handle_notify(SalOp *op, belle_sip_request_t *req){ } else { sub_state=SalSubscribeActive; } + resp = sal_op_create_response_from_request(op, req, 200); /*answer first because the op may be destroyed by notify_presence */ op->base.root->callbacks.notify_presence(op, sub_state, presence_model, NULL); - resp = sal_op_create_response_from_request(op, req, 200); + } else { /* Formatting error in presence notification body. */ ms_error("Wrongly formatted presence notification received");