bbdb_merge_buddy_to_contact: Use provided new() function and fix possible memory leak

This commit is contained in:
Milan Crha
2020-01-21 23:04:27 +01:00
parent 4ff78d5b95
commit f35dfd7d35

View File

@ -394,7 +394,7 @@ bbdb_merge_buddy_to_contact (EBookClient *client,
if (photo == NULL) {
gchar *contents = NULL;
photo = g_new0 (EContactPhoto, 1);
photo = e_contact_photo_new ();
photo->type = E_CONTACT_PHOTO_TYPE_INLINED;
if (!g_file_get_contents (
@ -404,6 +404,7 @@ bbdb_merge_buddy_to_contact (EBookClient *client,
"bbdb: Could not read buddy icon: "
"%s\n", error->message);
g_error_free (error);
e_contact_photo_free (photo);
return dirty;
}