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.
This commit is contained in:
William Lallemand 2022-04-26 15:57:33 +02:00
parent b0c4827c2f
commit 4cfbf3c014

View File

@ -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);