From 0a4873863445c47aa7ef739722ddf73a1b8ac67b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 15 Sep 2013 10:25:47 +0200 Subject: [PATCH] bin/xbps-remove/main.c: fix a memleak in the clean-cache code. --- bin/xbps-remove/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/xbps-remove/main.c b/bin/xbps-remove/main.c index 44245461..12faadd2 100644 --- a/bin/xbps-remove/main.c +++ b/bin/xbps-remove/main.c @@ -162,11 +162,13 @@ cachedir_clean(struct xbps_handle *xhp) if (xbps_file_hash_check(binpkg, rsha256) == ERANGE) { printf("Removed %s from cachedir (sha256 mismatch)\n", dp->d_name); + xbps_object_release(pkg_propsd); if (unlink(binpkg) == -1) fprintf(stderr, "Failed to remove " "`%s': %s\n", binpkg, strerror(errno)); } + xbps_object_release(pkg_propsd); free(binpkg); continue; } @@ -174,6 +176,7 @@ cachedir_clean(struct xbps_handle *xhp) if (unlink(binpkg) == -1) fprintf(stderr, "Failed to remove `%s': %s\n", binpkg, strerror(errno)); + xbps_object_release(pkg_propsd); free(binpkg); } closedir(dirp);