From e0643acbb085804fe542fc69734471af8c251fed Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 21 Jul 2013 10:49:30 +0200 Subject: [PATCH] xbps-query(8): fixed some memleaks in local/remote ownedby mode. --- NEWS | 2 ++ bin/xbps-query/ownedby.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 6990fd3e..81b56aa0 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ xbps-0.26 (???): + * xbps-query(8): fixed some memleaks in local and repository owned mode. + * xbps-query(8): fix regression in -R, also print repository string object. * Do not abort transaction if updates for conflicting packages are in diff --git a/bin/xbps-query/ownedby.c b/bin/xbps-query/ownedby.c index a607dcfa..e85b0d82 100644 --- a/bin/xbps-query/ownedby.c +++ b/bin/xbps-query/ownedby.c @@ -69,6 +69,7 @@ match_files_by_pattern(xbps_dictionary_t pkg_filesd, array = xbps_dictionary_get_keysym(pkg_filesd, key); for (i = 0; i < xbps_array_count(array); i++) { obj = xbps_array_get(array, i); + filestr = NULL; xbps_dictionary_get_cstring_nocopy(obj, "file", &filestr); if (filestr == NULL) continue; @@ -101,6 +102,9 @@ ownedby_pkgdb_cb(struct xbps_handle *xhp, xbps_object_t obj, void *arg, bool *do match_files_by_pattern(pkgmetad, xbps_array_get(files_keys, i), ffd, pkgver); } + xbps_object_release(pkgmetad); + xbps_object_release(files_keys); + return 0; } @@ -164,6 +168,8 @@ repo_ownedby_cb(struct xbps_repo *repo, void *arg, bool *done) pkgver = xbps_dictionary_keysym_cstring_nocopy(ksym); repo_match_files_by_pattern(pkgar, pkgver, ffd); } + xbps_object_release(filesd); + xbps_object_release(allkeys); return 0; }