bin/xbps-remove/main.c: fix a memleak in the clean-cache code.
This commit is contained in:
parent
4057e4961c
commit
0a48738634
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user