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:
parent
3c38741e71
commit
a6046586a3
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user