From 4cfbf3c014cf013542533d46b21ccc518ad8866c Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 26 Apr 2022 15:57:33 +0200 Subject: [PATCH] BUG/MINOR: ssl: memory leak when trying to load a directory with ca-file This patch fixes a memory leak of the ca structure when trying to load a directory with the ca-file directive. No backport needed. --- src/ssl_ckch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 589e69117..447fdbb56 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -1168,11 +1168,13 @@ int ssl_store_load_locations_file(char *path, int create_if_none, enum cafile_ty if (X509_STORE_add_cert(store, ca) == 0) goto scandir_err; + X509_free(ca); BIO_free(in); free(de); continue; scandir_err: + X509_free(ca); BIO_free(in); free(de); ha_warning("ca-file: '%s' couldn't load '%s'\n", path, trash.area);