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.
This commit is contained in:
Nikos Tsipinakis 2017-04-01 22:50:40 +03:00
parent 3c38741e71
commit a6046586a3

View File

@ -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);
}