From ffbdfeef6380a7b5b67018144356cbc02f90a85d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 26 Jul 2015 08:38:12 +0200 Subject: [PATCH] xbps-rindex/index-clean: fix a minor resource leak (CID #98689). --- bin/xbps-rindex/index-clean.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/xbps-rindex/index-clean.c b/bin/xbps-rindex/index-clean.c index 454b43a8..0d16db72 100644 --- a/bin/xbps-rindex/index-clean.c +++ b/bin/xbps-rindex/index-clean.c @@ -109,9 +109,10 @@ index_clean(struct xbps_handle *xhp, const char *repodir) repo = xbps_repo_open(xhp, repodir); if (repo == NULL) { rv = errno; - if (rv == ENOENT) + if (rv == ENOENT) { + xbps_repo_unlock(rlockfd, rlockfname); return 0; - + } fprintf(stderr, "%s: cannot read repository data: %s\n", _XBPS_RINDEX, strerror(errno)); xbps_repo_unlock(rlockfd, rlockfname);