mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-03 19:59:36 +00:00
Fixed segfault when manipulating friends with vcards without carddav configured
This commit is contained in:
parent
0676eaf4f1
commit
d458258237
2 changed files with 6 additions and 8 deletions
|
|
@ -451,11 +451,13 @@ static LinphoneFriendListStatus _linphone_friend_list_remove_friend(LinphoneFrie
|
|||
LinphoneVCard *lvc = linphone_friend_get_vcard(lf);
|
||||
if (lvc && linphone_vcard_get_uid(lvc)) {
|
||||
LinphoneCardDavContext *cdc = linphone_carddav_context_new(list);
|
||||
cdc->sync_done_cb = carddav_done;
|
||||
if (cdc->friend_list->cbs->sync_state_changed_cb) {
|
||||
cdc->friend_list->cbs->sync_state_changed_cb(cdc->friend_list, LinphoneFriendListSyncStarted, NULL);
|
||||
if (cdc) {
|
||||
cdc->sync_done_cb = carddav_done;
|
||||
if (cdc->friend_list->cbs->sync_state_changed_cb) {
|
||||
cdc->friend_list->cbs->sync_state_changed_cb(cdc->friend_list, LinphoneFriendListSyncStarted, NULL);
|
||||
}
|
||||
linphone_carddav_delete_vcard(cdc, lf);
|
||||
}
|
||||
linphone_carddav_delete_vcard(cdc, lf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,11 +120,7 @@ static void friends_migration(void) {
|
|||
BC_ASSERT_EQUAL(ms_list_size(friends), 3, int, "%d");
|
||||
friends_from_db = linphone_core_fetch_friends_from_db(manager->lc, lfl);
|
||||
BC_ASSERT_EQUAL(ms_list_size(friends_from_db), 3, int, "%d");
|
||||
if (ms_list_size(friends_from_db) < 3) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
friends_from_db = ms_list_free_with_data(friends_from_db, (void (*)(void *))linphone_friend_unref);
|
||||
unlink(friends_db);
|
||||
ms_free(friends_db);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue