From 24f0f9d79d0ef9388ca0f5296b9f2aec2c5b6fce Mon Sep 17 00:00:00 2001 From: smorlat Date: Wed, 17 Dec 2008 15:20:45 +0000 Subject: [PATCH] fix crash when deregestering. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@207 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/coreapi/exevents.c | 6 +++++- linphone/coreapi/proxy.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/linphone/coreapi/exevents.c b/linphone/coreapi/exevents.c index 95dd2e158..c1ff8848c 100644 --- a/linphone/coreapi/exevents.c +++ b/linphone/coreapi/exevents.c @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mediastreamer2/mediastream.h" #include #include +#include static int linphone_answer_sdp(LinphoneCore *lc, eXosip_event_t *ev, sdp_message_t *sdp); @@ -898,6 +899,7 @@ void linphone_registration_success(LinphoneCore *lc,eXosip_event_t *ev){ osip_uri_t *requri=osip_message_get_uri(ev->request); char *msg; char *ru; + osip_header_t *h=NULL; osip_uri_to_str(requri,&ru); msg=ms_strdup_printf(_("Registration on %s successful."),ru); lc->vtable.display_status(lc,msg); @@ -908,7 +910,9 @@ void linphone_registration_success(LinphoneCore *lc,eXosip_event_t *ev){ cfg->auth_pending=FALSE; cfg->registered=TRUE; gstate_new_state(lc, GSTATE_REG_OK, NULL); - linphone_proxy_config_register_again_with_updated_contact(cfg,ev->request,ev->response); + osip_message_get_expires(ev->request,0,&h); + if (h!=NULL && atoi(h->hvalue)!=0) + linphone_proxy_config_register_again_with_updated_contact(cfg,ev->request,ev->response); } static bool_t comes_from_local_if(osip_message_t *msg){ diff --git a/linphone/coreapi/proxy.c b/linphone/coreapi/proxy.c index c4badc229..5d6c93d7a 100644 --- a/linphone/coreapi/proxy.c +++ b/linphone/coreapi/proxy.c @@ -73,6 +73,7 @@ void linphone_proxy_config_register_again_with_updated_contact(LinphoneProxyConf return; } eXosip_lock(); + msg=NULL; eXosip_register_build_register(obj->rid,obj->expires,&msg); osip_message_get_contact(msg,0,&ctt); if (ctt->url->host!=NULL){