diff options
author | Dmitry Belyavskiy <beldmit@gmail.com> | 2024-02-27 15:22:58 +0100 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2024-03-07 11:03:31 +0100 |
commit | 6134e8e6ddc25c403fd1fab3f510a850a8843e62 (patch) | |
tree | f90257c684b1752680f99d7dac9e521012465907 /test/x509_load_cert_file_test.c | |
parent | 8d8866aff39399dbee2d49c59aca466794c53ba7 (diff) | |
download | openssl-6134e8e6ddc25c403fd1fab3f510a850a8843e62.zip openssl-6134e8e6ddc25c403fd1fab3f510a850a8843e62.tar.gz openssl-6134e8e6ddc25c403fd1fab3f510a850a8843e62.tar.bz2 |
Fix a memory leak on successful load of CRL
Fixes #23693
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23695)
Diffstat (limited to 'test/x509_load_cert_file_test.c')
-rw-r--r-- | test/x509_load_cert_file_test.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/x509_load_cert_file_test.c b/test/x509_load_cert_file_test.c index 001ed57..16caf48 100644 --- a/test/x509_load_cert_file_test.c +++ b/test/x509_load_cert_file_test.c @@ -12,6 +12,7 @@ #include "testutil.h" static const char *chain; +static const char *crl; static int test_load_cert_file(void) { @@ -36,6 +37,9 @@ static int test_load_cert_file(void) goto err; } + if (crl != NULL && !TEST_true(X509_load_crl_file(lookup, crl, X509_FILETYPE_PEM))) + goto err; + ret = 1; err: @@ -45,7 +49,7 @@ err: return ret; } -OPT_TEST_DECLARE_USAGE("cert.pem...\n") +OPT_TEST_DECLARE_USAGE("cert.pem [crl.pem]\n") int setup_tests(void) { @@ -58,6 +62,8 @@ int setup_tests(void) if (chain == NULL) return 0; + crl = test_get_argument(1); + ADD_TEST(test_load_cert_file); return 1; } |