lib/transaction_commit.c: fix a double free (reported by Hanspolo).

This commit is contained in:
Juan RP 2014-01-28 20:51:57 +01:00
parent 2bacf4887d
commit fb5fb91fa3

View File

@ -166,6 +166,7 @@ download_binpkgs(struct xbps_handle *xhp, xbps_object_iterator_t iter)
*/ */
sigfile = xbps_xasprintf("%s.sig", file); sigfile = xbps_xasprintf("%s.sig", file);
free(file); free(file);
file = NULL;
if (access(sigfile, R_OK) == -1) { if (access(sigfile, R_OK) == -1) {
xbps_set_cb_state(xhp, XBPS_STATE_DOWNLOAD, 0, pkgver, xbps_set_cb_state(xhp, XBPS_STATE_DOWNLOAD, 0, pkgver,
"Downloading `%s' signature (from `%s')...", pkgver, repoloc); "Downloading `%s' signature (from `%s')...", pkgver, repoloc);
@ -182,6 +183,7 @@ download_binpkgs(struct xbps_handle *xhp, xbps_object_iterator_t iter)
} }
} }
free(sigfile); free(sigfile);
if (file != NULL)
free(file); free(file);
} }
xbps_object_iterator_reset(iter); xbps_object_iterator_reset(iter);