xbps-rindex/index-clean: fix a minor resource leak (CID #98689).
This commit is contained in:
parent
78f9a97980
commit
ffbdfeef63
@ -109,9 +109,10 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
|
|||||||
repo = xbps_repo_open(xhp, repodir);
|
repo = xbps_repo_open(xhp, repodir);
|
||||||
if (repo == NULL) {
|
if (repo == NULL) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
if (rv == ENOENT)
|
if (rv == ENOENT) {
|
||||||
|
xbps_repo_unlock(rlockfd, rlockfname);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
fprintf(stderr, "%s: cannot read repository data: %s\n",
|
fprintf(stderr, "%s: cannot read repository data: %s\n",
|
||||||
_XBPS_RINDEX, strerror(errno));
|
_XBPS_RINDEX, strerror(errno));
|
||||||
xbps_repo_unlock(rlockfd, rlockfname);
|
xbps_repo_unlock(rlockfd, rlockfname);
|
||||||
|
Loading…
Reference in New Issue
Block a user