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) {
|
if (xbps_file_hash_check(binpkg, rsha256) == ERANGE) {
|
||||||
printf("Removed %s from cachedir (sha256 mismatch)\n",
|
printf("Removed %s from cachedir (sha256 mismatch)\n",
|
||||||
dp->d_name);
|
dp->d_name);
|
||||||
|
xbps_object_release(pkg_propsd);
|
||||||
if (unlink(binpkg) == -1)
|
if (unlink(binpkg) == -1)
|
||||||
fprintf(stderr, "Failed to remove "
|
fprintf(stderr, "Failed to remove "
|
||||||
"`%s': %s\n", binpkg,
|
"`%s': %s\n", binpkg,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
|
xbps_object_release(pkg_propsd);
|
||||||
free(binpkg);
|
free(binpkg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -174,6 +176,7 @@ cachedir_clean(struct xbps_handle *xhp)
|
|||||||
if (unlink(binpkg) == -1)
|
if (unlink(binpkg) == -1)
|
||||||
fprintf(stderr, "Failed to remove `%s': %s\n",
|
fprintf(stderr, "Failed to remove `%s': %s\n",
|
||||||
binpkg, strerror(errno));
|
binpkg, strerror(errno));
|
||||||
|
xbps_object_release(pkg_propsd);
|
||||||
free(binpkg);
|
free(binpkg);
|
||||||
}
|
}
|
||||||
closedir(dirp);
|
closedir(dirp);
|
||||||
|
Loading…
Reference in New Issue
Block a user