talons

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

commit 52b0e21c190fa02e9b5dde7cd95f8c9ee339288c
parent 78547fd63e16a76d656e668c17b7ae8975c46e12
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Sat,  9 Mar 2019 21:22:34 +0100

Add a forgotten fclose() call

Fixes CID 1443021.

Diffstat:
Msrc/procmime.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/procmime.c b/src/procmime.c @@ -2731,7 +2731,12 @@ void *procmime_get_part_as_string(MimeInfo *mimeinfo, length = mimeinfo->length; data = g_malloc(null_terminate ? length + 1 : length); - cm_return_val_if_fail(data != NULL, NULL); + if (data == NULL) { + g_warning("Could not allocate %d bytes for procmime_get_part_as_string.\n", + (null_terminate ? length + 1 : length)); + claws_fclose(infp); + return NULL; + } readlength = claws_fread(data, length, 1, infp); if (readlength <= 0) {