From f35dfd7d3525105a55519385c093f6eb5cba91bf Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 21 Jan 2020 23:04:27 +0100 Subject: [PATCH] bbdb_merge_buddy_to_contact: Use provided new() function and fix possible memory leak --- src/plugins/bbdb/gaimbuddies.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/bbdb/gaimbuddies.c b/src/plugins/bbdb/gaimbuddies.c index a306321ce9..65b9e89b43 100644 --- a/src/plugins/bbdb/gaimbuddies.c +++ b/src/plugins/bbdb/gaimbuddies.c @@ -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; }