lib/transaction_commit.c: fix a use-after-free in state cb (found by ojab).

This commit is contained in:
Juan RP 2013-03-26 10:35:20 +01:00
parent e25216822b
commit 7c4f20ba89

View File

@ -88,11 +88,11 @@ check_binpkgs_hash(struct xbps_handle *xhp, prop_object_iterator_t iter)
rv = xbps_file_hash_check(binfile, sha256); rv = xbps_file_hash_check(binfile, sha256);
if (rv != 0) { if (rv != 0) {
free(binfile); free(binfile);
free(filen);
xbps_set_cb_state(xhp, XBPS_STATE_VERIFY_FAIL, xbps_set_cb_state(xhp, XBPS_STATE_VERIFY_FAIL,
rv, pkgver, rv, pkgver,
"Failed to verify `%s' package integrity: %s", "Failed to verify `%s' package integrity: %s",
filen, strerror(rv)); filen, strerror(rv));
free(filen);
break; break;
} }
free(binfile); free(binfile);