From 909086ea61c985bce9ac4d015e47eeb45586a6de Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 17 Mar 2020 16:53:27 +0100 Subject: [PATCH] BUG/MINOR: ssl: memory leak in crtlist_parse_file() A memory leak happens in an error case when ckchs_load_cert_file() returns NULL in crtlist_parse_file(). This bug was introduced by commit 2954c47 ("MEDIUM: ssl: allow crt-list caching") This patch fixes bug #551. --- src/ssl_sock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 8d3434a11..2c7892c16 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -4846,10 +4846,8 @@ static int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct pr else ckchs = ckchs_load_cert_file(crt_path, 1, err); } - if (ckchs == NULL) { + if (ckchs == NULL) cfgerr |= ERR_ALERT | ERR_FATAL; - goto error; - } entry = malloc(sizeof(*entry)); if (entry == NULL) {