aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-12-28 21:13:43 -0500
committerMike Frysinger <vapier@gentoo.org>2016-12-28 21:13:43 -0500
commit5afabfc0042833b548309a918ad84bbdebfefd05 (patch)
treeca2e938c6e75772e3ff200ee5975235a9c12d8a3 /qtbz2.c
parenttests: ignore emaint failures for non-Gentoo systems (i.e. travis) (diff)
downloadportage-utils-5afabfc0042833b548309a918ad84bbdebfefd05.tar.gz
portage-utils-5afabfc0042833b548309a918ad84bbdebfefd05.tar.bz2
portage-utils-5afabfc0042833b548309a918ad84bbdebfefd05.zip
qtbz2: fix leakage of dir_fd via the -d option
Diffstat (limited to 'qtbz2.c')
-rw-r--r--qtbz2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/qtbz2.c b/qtbz2.c
index 723ad27..3c2e9f0 100644
--- a/qtbz2.c
+++ b/qtbz2.c
@@ -353,9 +353,14 @@ int qtbz2_main(int argc, char **argv)
warn("Could not decompose '%s'", tbz2);
}
+ /* We have to cleanup all resources as we're used indirectly
+ * (e.g. via qmerge).
+ */
free(heap_tbz2);
free(heap_xpak);
free(heap_tarbz2);
+ if (dir_fd != AT_FDCWD)
+ close(dir_fd);
return EXIT_SUCCESS;
}