commit:     e61179d1b30ac9b95d85788c320b6cfcb567171a
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 01:50:36 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 01:50:36 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e61179d1

cache: fix fclose(NULL) error when cache reading fails

 main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main.c b/main.c
index ff7648d..b99768d 100644
--- a/main.c
+++ b/main.c
@@ -1303,7 +1303,7 @@ portage_cache *cache_read_file_md5(const char *file)
        return ret;
 
 err:
-       fclose(f);
+       if (f) fclose(f);
        if (ret) cache_free(ret);
        return NULL;
 }

Reply via email to