]> sjero.net Git - linphone/commitdiff
Fix crash when the entered uri is invalid
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Tue, 25 Oct 2011 10:23:09 +0000 (12:23 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Tue, 25 Oct 2011 10:23:09 +0000 (12:23 +0200)
coreapi/friend.c

index 853902b45f23dfbdb9cf085b550c05691bebe26a..05a1baeec3a7ed26013cc44a758b614042dc138f 100644 (file)
@@ -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);