Commit 5c0bdf95 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed another leak

parent 6c146116
...@@ -919,6 +919,10 @@ int linphone_core_import_friends_from_vcard4_file(LinphoneCore *lc, const char * ...@@ -919,6 +919,10 @@ int linphone_core_import_friends_from_vcard4_file(LinphoneCore *lc, const char *
#ifndef VCARD_ENABLED #ifndef VCARD_ENABLED
ms_error("vCard support wasn't enabled at compilation time"); ms_error("vCard support wasn't enabled at compilation time");
#endif #endif
if (!vcards) {
ms_error("Failed to parse the file %s", vcard_file);
return -1;
}
while (vcards != NULL && vcards->data != NULL) { while (vcards != NULL && vcards->data != NULL) {
LinphoneVCard *vcard = (LinphoneVCard *)vcards->data; LinphoneVCard *vcard = (LinphoneVCard *)vcards->data;
LinphoneFriend *lf = linphone_friend_new_from_vcard(vcard); LinphoneFriend *lf = linphone_friend_new_from_vcard(vcard);
...@@ -927,6 +931,8 @@ int linphone_core_import_friends_from_vcard4_file(LinphoneCore *lc, const char * ...@@ -927,6 +931,8 @@ int linphone_core_import_friends_from_vcard4_file(LinphoneCore *lc, const char *
count++; count++;
} }
linphone_friend_unref(lf); linphone_friend_unref(lf);
} else {
linphone_vcard_free(vcard);
} }
vcards = ms_list_next(vcards); vcards = ms_list_next(vcards);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment