From cf903840233904de85858aa180f1a6b2e339a45d Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Thu, 2 Sep 2021 23:10:37 +0200 Subject: [PATCH] Allow -tls_ca{file,path} '' to unset an argument --- src/fe-common/core/fe-server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index de45f8e9..78e7202c 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -213,12 +213,16 @@ static void cmd_server_add_modify(const char *data, gboolean add) value = g_hash_table_lookup(optlist, "ssl_cafile"); if (value != NULL && *value != '\0') rec->tls_cafile = g_strdup(value); + else if (value != NULL && *value == '\0') + g_free_and_null(rec->tls_cafile); value = g_hash_table_lookup(optlist, "tls_capath"); if (value == NULL) value = g_hash_table_lookup(optlist, "ssl_capath"); if (value != NULL && *value != '\0') rec->tls_capath = g_strdup(value); + else if (value != NULL && *value == '\0') + g_free_and_null(rec->tls_capath); value = g_hash_table_lookup(optlist, "tls_ciphers"); if (value == NULL)