From: Andrej Kacian Date: Sat, 9 Mar 2019 20:22:34 +0000 (+0100) Subject: Add a forgotten fclose() call X-Git-Tag: 3.17.4~74 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=bf12f9db42b654c77c537a68796949963bb76f4a Add a forgotten fclose() call Fixes CID 1443021. --- diff --git a/src/procmime.c b/src/procmime.c index 6c682a624..6bcf5bbfc 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -2692,7 +2692,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) {