Fix a crash with malformed user notice policy numbers
[openssl.git] / crypto / x509v3 / v3_cpols.c
index a69733848874fea62277d34c954dad7cf9a6a1a5..f717e132d4a0b3f9798f0bcf45bf510ab599e72f 100644 (file)
@@ -345,10 +345,10 @@ static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos)
     return 1;
 
  merr:
+    ASN1_INTEGER_free(aint);
     X509V3err(X509V3_F_NREF_NOS, ERR_R_MALLOC_FAILURE);
 
  err:
-    sk_ASN1_INTEGER_pop_free(nnums, ASN1_STRING_free);
     return 0;
 }