commit bf12f9db42b654c77c537a68796949963bb76f4a
parent f9c17d6035dd404039041d1d1d210b5ecf1abc0c
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:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git 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) {