commit:     dca3d11e3059e24241b9104daa7b466f2a3d3f79
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 26 19:11:11 2026 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Jan 26 19:49:56 2026 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dca3d11e

qpkg: fix possible leak on invalid call, CID 557211

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

 qpkg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/qpkg.c b/qpkg.c
index e0bbaa49..3f483970 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -77,7 +77,7 @@ qpkg_clean(qpkg_cb_args *args)
        size_t disp_units = 0;
        uint64_t num_all_bytes = 0;
        array *bins;
-       array *trees = array_new();
+       array *trees;
        tree_ctx *t;
        tree_ctx *pkgs;
        tree_pkg_ctx *binpkg;
@@ -87,7 +87,8 @@ qpkg_clean(qpkg_cb_args *args)
        if (pkgs == NULL)
                return 1;
 
-       bins = tree_match_atom(pkgs, NULL, TREE_MATCH_DEFAULT);
+       bins  = tree_match_atom(pkgs, NULL, TREE_MATCH_DEFAULT);
+       trees = array_new();
 
        if (args->clean_notintree) {
                const char *overlay;

Reply via email to