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.
diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c
index 589e691..447fdbb 100644
--- a/src/ssl_ckch.c
+++ b/src/ssl_ckch.c
@@ -1168,11 +1168,13 @@
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);