From a6046586a373de6681e84499681ce82ce3e539ba Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Sat, 1 Apr 2017 22:50:40 +0300 Subject: [PATCH] Fix minor memory leak When checking for the markup value in rules, an empty string was specified as the default value so it can easily be checked if the actual config value was empty or not. While that string got strdup'ed in the ini_get_string call, it was only freed if the length > 0, effectively leaking a tiny amount of memory. Change that behaviour to use a NULL check instead to avoid leaking memory. --- src/settings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings.c b/src/settings.c index cdd84de..9bf3e2b 100644 --- a/src/settings.c +++ b/src/settings.c @@ -570,10 +570,10 @@ void load_settings(char *cmdline_config_path) { char *c = ini_get_string( cur_section, - "markup", "" + "markup", NULL ); - if (strlen(c) > 0) { + if (c != NULL) { r->markup = parse_markup_mode(c); g_free(c); }