MINOR: ssl: don't alloc ssl_conf if no option found
When no SSL options were found between brackets, the structure ssl_conf
was still allocated for nothing.
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 1cd701e..376e624 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -4784,11 +4784,13 @@
*crt_path = args[0];
- ssl_conf = calloc(1, sizeof *ssl_conf);
- if (!ssl_conf) {
- memprintf(err, "not enough memory!");
- cfgerr |= ERR_ALERT | ERR_FATAL;
- goto error;
+ if (ssl_b) {
+ ssl_conf = calloc(1, sizeof *ssl_conf);
+ if (!ssl_conf) {
+ memprintf(err, "not enough memory!");
+ cfgerr |= ERR_ALERT | ERR_FATAL;
+ goto error;
+ }
}
cur_arg = ssl_b ? ssl_b : 1;
while (cur_arg < ssl_e) {