summaryrefslogtreecommitdiff
path: root/modules/ssl
diff options
context:
space:
mode:
authorGiovanni Bechis <gbechis@apache.org>2022-02-24 11:39:59 +0000
committerGiovanni Bechis <gbechis@apache.org>2022-02-24 11:39:59 +0000
commitea2c84a0e33d7f2564e77633f8a6c56046fa1618 (patch)
treed8576d6fc10f8a67bc26c6d10d6d38d470ea6c3e /modules/ssl
parent669bdbb45bff9f9b85408d869296b00ed14e5b1e (diff)
downloadhttpd-ea2c84a0e33d7f2564e77633f8a6c56046fa1618.tar.gz
release memory if needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898366 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/ssl')
-rw-r--r--modules/ssl/ssl_util_ocsp.c5
-rw-r--r--modules/ssl/ssl_util_stapling.c4
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);