diff options
author | Giovanni Bechis <gbechis@apache.org> | 2022-02-24 12:39:59 +0100 |
---|---|---|
committer | Giovanni Bechis <gbechis@apache.org> | 2022-02-24 12:39:59 +0100 |
commit | ea2c84a0e33d7f2564e77633f8a6c56046fa1618 (patch) | |
tree | d8576d6fc10f8a67bc26c6d10d6d38d470ea6c3e | |
parent | Resolves BZ65861 - clarify post_config api doc (diff) | |
download | apache2-ea2c84a0e33d7f2564e77633f8a6c56046fa1618.tar.xz apache2-ea2c84a0e33d7f2564e77633f8a6c56046fa1618.zip |
release memory if needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898366 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | modules/ssl/ssl_util_ocsp.c | 5 | ||||
-rw-r--r-- | modules/ssl/ssl_util_stapling.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/modules/ssl/ssl_util_ocsp.c b/modules/ssl/ssl_util_ocsp.c index b8d27f9be7..fbbec07acc 100644 --- a/modules/ssl/ssl_util_ocsp.c +++ b/modules/ssl/ssl_util_ocsp.c @@ -373,8 +373,11 @@ static STACK_OF(X509) *modssl_read_ocsp_certificates(const char *file) while ((x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL)) != NULL) { if (!other_certs) { other_certs = sk_X509_new_null(); - if (!other_certs) + if (!other_certs) { + X509_free(x509); + BIO_free(bio); return NULL; + } } if (!sk_X509_push(other_certs, x509)) { diff --git a/modules/ssl/ssl_util_stapling.c b/modules/ssl/ssl_util_stapling.c index 88ad0b7419..8ccbbe4034 100644 --- a/modules/ssl/ssl_util_stapling.c +++ b/modules/ssl/ssl_util_stapling.c @@ -113,8 +113,10 @@ static X509 *stapling_get_issuer(modssl_ctx_t *mctx, X509 *x) } inctx = X509_STORE_CTX_new(); - if (!X509_STORE_CTX_init(inctx, st, NULL, NULL)) + if (!X509_STORE_CTX_init(inctx, st, NULL, NULL)) { + X509_STORE_CTX_free(inctx); return 0; + } if (X509_STORE_CTX_get1_issuer(&issuer, inctx, x) <= 0) issuer = NULL; X509_STORE_CTX_cleanup(inctx); |