From dde5fff4a533695f1d2559ef60f22caf66801e03 Mon Sep 17 00:00:00 2001 From: Zero King Date: Sat, 27 Jul 2019 18:34:03 +0000 Subject: [PATCH] Fix memory leaks --- src/core/settings.c | 1 + src/irc/dcc/dcc-resume.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/settings.c b/src/core/settings.c index 2bd6c06a..9b50f6f4 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -229,6 +229,7 @@ static void settings_add(const char *module, const char *section, if (rec->type != type) { g_warning("Trying to add already existing " "setting '%s' with different type.", key); + g_strfreev(choices_vec); return; } rec->refcount++; diff --git a/src/irc/dcc/dcc-resume.c b/src/irc/dcc/dcc-resume.c index b0438e79..dd62ff9d 100644 --- a/src/irc/dcc/dcc-resume.c +++ b/src/irc/dcc/dcc-resume.c @@ -92,8 +92,10 @@ static int dcc_ctcp_resume_parse(int type, const char *data, const char *nick, params = g_strsplit(data, " ", -1); paramcount = g_strv_length(params); - if (paramcount < 3) + if (paramcount < 3) { + g_strfreev(params); return 0; + } fileparams = get_file_params_count_resume(params, paramcount);