summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509
diff options
context:
space:
mode:
authortb <>2025-11-03 16:36:15 +0000
committertb <>2025-11-03 16:36:15 +0000
commit73bce59b2aaca7d3ae9dd6087472dbfdca23c83f (patch)
treefe718990bb7d13e3fd2634f3c901355ba5dd1b97 /src/lib/libcrypto/x509
parent397ac5a0503a9527af9a1f166a1044a93d16bddc (diff)
downloadopenbsd-73bce59b2aaca7d3ae9dd6087472dbfdca23c83f.tar.gz
openbsd-73bce59b2aaca7d3ae9dd6087472dbfdca23c83f.tar.bz2
openbsd-73bce59b2aaca7d3ae9dd6087472dbfdca23c83f.zip
In nref_nos() don't leak the ASN1_INTEGER if the push fails
(A much bigger problem here is a double free for which I will send out a diff shortly) From Niels Dossche
Diffstat (limited to 'src/lib/libcrypto/x509')
-rw-r--r--src/lib/libcrypto/x509/x509_cpols.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_cpols.c b/src/lib/libcrypto/x509/x509_cpols.c
index 2c36cbd0f8..e075f462ad 100644
--- a/src/lib/libcrypto/x509/x509_cpols.c
+++ b/src/lib/libcrypto/x509/x509_cpols.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_cpols.c,v 1.18 2025/11/03 16:22:13 tb Exp $ */ 1/* $OpenBSD: x509_cpols.c,v 1.19 2025/11/03 16:36:15 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -680,8 +680,10 @@ nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos)
680 X509V3error(X509V3_R_INVALID_NUMBER); 680 X509V3error(X509V3_R_INVALID_NUMBER);
681 goto err; 681 goto err;
682 } 682 }
683 if (!sk_ASN1_INTEGER_push(nnums, aint)) 683 if (!sk_ASN1_INTEGER_push(nnums, aint)) {
684 ASN1_INTEGER_free(aint);
684 goto merr; 685 goto merr;
686 }
685 } 687 }
686 return 1; 688 return 1;
687 689