cms_SignerInfo_content_sign: free sig on failure path

Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Jonas Maebe 2013-12-08 17:16:57 +01:00 committed by Kurt Roeckx
parent 4e64f671c9
commit 36f7ed5040

View file

@ -680,7 +680,10 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms,
goto err;
}
if (EVP_PKEY_sign(pctx, sig, &siglen, md, mdlen) <= 0)
{
OPENSSL_free(sig);
goto err;
}
ASN1_STRING_set0(si->signature, sig, siglen);
}
else