commit:     46c32287c3a4f0905ba051dfbfba93973b81e157
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 12 18:30:37 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Feb 12 18:30:37 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=46c32287

qmanifest: fix Coverity resource leak CID 206540

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qmanifest.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qmanifest.c b/qmanifest.c
index a00dbd2..72d6362 100644
--- a/qmanifest.c
+++ b/qmanifest.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2019 Gentoo Foundation
+ * Copyright 2018-2021 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
  *
  * Copyright 2018-     Fabian Groffen  - <[email protected]>
@@ -438,8 +438,10 @@ generate_dir(const char *dir, enum type_manifest mtype)
                        return NULL;
                }
 
-               if (list_dir(&dentries, &dentrieslen, dir) != 0)
+               if (list_dir(&dentries, &dentrieslen, dir) != 0) {
+                       gzclose(mf);
                        return NULL;
+               }
 
                for (i = 0; i < dentrieslen; i++) {
                        /* ignore existing Manifests */

Reply via email to