From 552b4381afa04a4c8123cfc00452b6b539674005 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Thu, 2 May 2019 13:47:22 +0200 Subject: [PATCH] evas_test_image: Fix resource leak Summary: Coverity reports that we leak variable 'f' going out of scope here, so if we are going to exit the test, lets close the file before we do Fixes CID1400945 @fix Depends on D8770 Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8771 --- src/tests/evas/evas_test_image.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c index 259cff7..19ae8ff 100644 --- a/src/tests/evas/evas_test_image.c +++ b/src/tests/evas/evas_test_image.c @@ -647,6 +647,7 @@ _file_to_memory(const char *filename, char **result) if ((size_t)size != fread(*result, sizeof(char), size, f)) { free(*result); + fclose(f); return -1; } fclose(f); -- 2.7.4