From 236b86ae50c9443252ba0ea0fc33f38816cd6880 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 23 Oct 2009 11:11:57 +0200 Subject: [PATCH] xbps_check_is_installed_pkg: fix a leak in error paths reported by valgrind. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091023091157-h3tlqw2nz67m72ep --- lib/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/util.c b/lib/util.c index bc52bc87..62cb36d1 100644 --- a/lib/util.c +++ b/lib/util.c @@ -134,13 +134,16 @@ xbps_check_is_installed_pkg(const char *pkg) * unpacked or something else. */ if (xbps_get_pkg_state_installed(pkgname, &state) != 0) { + prop_object_release(dict); free(pkgname); return -1; } free(pkgname); - if (state != XBPS_PKG_STATE_INSTALLED) + if (state != XBPS_PKG_STATE_INSTALLED) { + prop_object_release(dict); return -1; + } /* Get version from installed package */ prop_dictionary_get_cstring_nocopy(dict, "version", &instver);