From 34b9acbd3f81b46967f692c0af49020c8c405746 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 27 Apr 2016 14:17:33 +0100 Subject: [PATCH] Free an ASN1_OBJECT in an error path The r2i_certpol() function allocates an ASN1_OBJECT but can fail to free it in an error path. Reviewed-by: Richard Levitte --- crypto/x509v3/v3_cpols.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/x509v3/v3_cpols.c b/crypto/x509v3/v3_cpols.c index b4dd3ad9fe..f1db67f24e 100644 --- a/crypto/x509v3/v3_cpols.c +++ b/crypto/x509v3/v3_cpols.c @@ -188,6 +188,7 @@ static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, pol = POLICYINFO_new(); if (pol == NULL) { X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_MALLOC_FAILURE); + ASN1_OBJECT_free(pobj); goto err; } pol->policyid = pobj; -- 2.34.1