]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: memory leak in crtlist_parse_file()
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 17 Mar 2020 15:53:27 +0000 (16:53 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 17 Mar 2020 15:57:34 +0000 (16:57 +0100)
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

index 8d3434a114f73cdb283537f02520690893d06e73..2c7892c163bf21f1bc8e3240f14855f5ec3c4118 100644 (file)
@@ -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) {