diff options
author | tb <> | 2022-07-24 21:41:29 +0000 |
---|---|---|
committer | tb <> | 2022-07-24 21:41:29 +0000 |
commit | b5de8ebc8e95155a8fd1856747859b9e5a2fd1d4 (patch) | |
tree | 757d085e95b87db55a2820af77e2242c5ffd1e4a | |
parent | ccb527947108c08b334954f118a557573e961a25 (diff) | |
download | openbsd-b5de8ebc8e95155a8fd1856747859b9e5a2fd1d4.tar.gz openbsd-b5de8ebc8e95155a8fd1856747859b9e5a2fd1d4.tar.bz2 openbsd-b5de8ebc8e95155a8fd1856747859b9e5a2fd1d4.zip |
Plug leak in X509V3_add1_i2d()
Do not leak the extension that was deleted from the stack.
via OpenSSL c3efe5c9.
ok jsing
-rw-r--r-- | src/lib/libcrypto/x509/x509_lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_lib.c b/src/lib/libcrypto/x509/x509_lib.c index a518d5b950..e265d30f89 100644 --- a/src/lib/libcrypto/x509/x509_lib.c +++ b/src/lib/libcrypto/x509/x509_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_lib.c,v 1.3 2021/11/01 20:53:08 tb Exp $ */ | 1 | /* $OpenBSD: x509_lib.c,v 1.4 2022/07/24 21:41:29 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 | */ |
@@ -314,8 +314,9 @@ X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, | |||
314 | } | 314 | } |
315 | /* If delete, just delete it */ | 315 | /* If delete, just delete it */ |
316 | if (ext_op == X509V3_ADD_DELETE) { | 316 | if (ext_op == X509V3_ADD_DELETE) { |
317 | if (!sk_X509_EXTENSION_delete(*x, extidx)) | 317 | if ((extmp = sk_X509_EXTENSION_delete(*x, extidx)) == NULL) |
318 | return -1; | 318 | return -1; |
319 | X509_EXTENSION_free(extmp); | ||
319 | return 1; | 320 | return 1; |
320 | } | 321 | } |
321 | } else { | 322 | } else { |