talons

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

commit 4da0c05d2715f855ca78c98b2187688919dbfc0c
parent c577fa6a1d5764e7086214d622a003b3716cc44a
Author: Colin Leroy <colin@colino.net>
Date:   Sun,  7 Jul 2019 18:44:54 +0200

Fix dereferencing of potentially NULL *error

Diffstat:
Msrc/procmime.c | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/procmime.c b/src/procmime.c @@ -2750,16 +2750,13 @@ GdkPixbuf *procmime_get_part_as_pixbuf(MimeInfo *mimeinfo, GError **error) *error = NULL; stream = procmime_get_part_as_inputstream(mimeinfo); - if (stream == NULL) { - if (*error) - *error = g_error_new_literal(G_FILE_ERROR, -1, _("Could not decode part")); + if (stream == NULL) return NULL; - } pixbuf = gdk_pixbuf_new_from_stream(stream, NULL, error); g_object_unref(stream); - if (*error != NULL) + if (error && *error != NULL) return NULL; return pixbuf;