From 711f2ea7f5448c4682e253e6399bea3a7651868f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 11 Dec 2013 12:39:15 +0100 Subject: [PATCH] bin/xbps-rindex/sign.c: fix a double free in error path found by clang-analyzer. --- bin/xbps-rindex/sign.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/xbps-rindex/sign.c b/bin/xbps-rindex/sign.c index 6e678387..288f1f91 100644 --- a/bin/xbps-rindex/sign.c +++ b/bin/xbps-rindex/sign.c @@ -178,10 +178,8 @@ sign_repo(struct xbps_handle *xhp, const char *repodir, defprivkey = strdup(privkey); rsa = rsa_sign_buf(defprivkey, xml, &sig, &siglen); - if (rsa == NULL) { - free(xml); + if (rsa == NULL) goto out; - } /* * If the signature in repo has not changed do not generate the * repodata file again.