From 06b0f86ef442b8973f3eaf829d9d47ee0ff5a65c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 6 Feb 2014 16:34:45 +0100 Subject: [PATCH] Revert "xbps-rindex: [sign] pubkey buffer must be kept until index-meta is externalized too." This reverts commit cbe05bd0f4a07c0fcd451c1dc2485bd35b7fb445. --- bin/xbps-rindex/sign.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/xbps-rindex/sign.c b/bin/xbps-rindex/sign.c index 795ab151..19392590 100644 --- a/bin/xbps-rindex/sign.c +++ b/bin/xbps-rindex/sign.c @@ -128,7 +128,7 @@ sign_repo(struct xbps_handle *xhp, const char *repodir, unsigned int siglen; uint16_t rpubkeysize, pubkeysize; const char *arch, *pkgver, *rsignedby = NULL; - char *binpkg, *binpkg_sig, *buf = NULL, *defprivkey; + char *binpkg, *binpkg_sig, *buf, *defprivkey; int binpkg_fd, binpkg_sig_fd, rv = 0; bool flush = false; @@ -265,6 +265,7 @@ sign_repo(struct xbps_handle *xhp, const char *repodir, if (!xbps_data_equals(rpubkey, data)) flush = true; + free(buf); pubkeysize = RSA_size(rsa) * 8; xbps_dictionary_get_uint16(repo->idxmeta, "public-key-size", &rpubkeysize); @@ -297,8 +298,6 @@ sign_repo(struct xbps_handle *xhp, const char *repodir, out: index_unlock(il); - if (buf) - free(buf); if (data) xbps_object_release(data); if (rsa) {