Fix a crash with malformed user notice policy numbers
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 2 Feb 2017 12:36:10 +0000 (13:36 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 5 Feb 2017 00:04:39 +0000 (01:04 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2352)

crypto/x509v3/v3_cpols.c

index a697338..f717e13 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;
 }