From 7c1668314bd578e81eb1051e5c78e30a4679a520 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 25 Oct 2011 12:23:09 +0200 Subject: [PATCH] Fix crash when the entered uri is invalid --- coreapi/friend.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreapi/friend.c b/coreapi/friend.c index 853902b45..05a1baeec 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -444,6 +444,10 @@ LinphoneFriend *linphone_core_get_friend_by_address(const LinphoneCore *lc, cons } username=linphone_address_get_username(puri); domain=linphone_address_get_domain(puri); + if (domain==NULL) { + linphone_address_destroy(puri); + return NULL; + } for(elem=lc->friends;elem!=NULL;elem=ms_list_next(elem)){ lf=(LinphoneFriend*)elem->data; const char *it_username=linphone_address_get_username(lf->uri);