talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit d42f3d7e5f9e65d045be32a71c8a67e7de7a2591
parent a0cd23ecbb4ea8b3bc76568b47e8e9451678a2cb
Author: Ricardo Mones <ricardo@mones.org>
Date:   Sun, 21 Jun 2020 19:41:40 +0200

Fix bug 4220 "generates files in cache without content"

Also replace "safe" call, since file should not be locked and is
going to be deleted anyway.

Diffstat:
Msrc/plugins/libravatar/libravatar_image.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/libravatar/libravatar_image.c b/src/plugins/libravatar/libravatar_image.c @@ -83,6 +83,7 @@ static GdkPixbuf *pixbuf_from_url(const gchar *url, const gchar *md5, const gcha curl = curl_easy_init(); if (curl == NULL) { g_warning("could not initialize curl to get image from URL"); + unlink(filename); claws_fclose(file); return NULL; } @@ -113,7 +114,8 @@ static GdkPixbuf *pixbuf_from_url(const gchar *url, const gchar *md5, const gcha res = curl_easy_perform(curl); if (res != CURLE_OK) { debug_print("curl_easy_perfom failed: %s", curl_easy_strerror(res)); - claws_safe_fclose(file); + unlink(filename); + claws_fclose(file); } else { filesize = ftell(file); claws_safe_fclose(file);