]> jfr.im git - irc/irssi/irssi.git/commitdiff
Allow -tls_ca{file,path} '' to unset an argument
authorJari Matilainen <redacted>
Thu, 2 Sep 2021 21:10:37 +0000 (23:10 +0200)
committerGitHub <redacted>
Thu, 2 Sep 2021 21:10:37 +0000 (23:10 +0200)
src/fe-common/core/fe-server.c

index de45f8e9e4b8765ec98174712652147f2e5786a2..78e7202c299290f5df097f324cf8a271cd97ff1f 100644 (file)
@@ -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)