talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 8a6bba660a93192b78978933928589ff8a1e9f75
parent b42968f69c8c870c4e4c586fb0025179cc649c3d
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Mon, 17 Dec 2018 20:20:24 +0100

Remove code duplication in get_certificate_path().

Diffstat:
Msrc/common/ssl_certificate.c | 16++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c @@ -59,19 +59,15 @@ static gchar *get_certificate_path(const gchar *host, const gchar *port, const g if (fp != NULL && prefs_common_unsafe_ssl_certs()) { filename = g_strconcat(host, ".", port, ".", fp, ".cert", NULL); - subst_for_filename(filename); - - ret = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, - "certs", G_DIR_SEPARATOR_S, - filename, NULL); } else { filename = g_strconcat(host, ".", port, ".cert", NULL); - subst_for_filename(filename); - - ret = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, - "certs", G_DIR_SEPARATOR_S, - filename, NULL); } + subst_for_filename(filename); + + ret = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, + "certs", G_DIR_SEPARATOR_S, + filename, NULL); + g_free(filename); return ret; }