Fix memleak in config parsing (variables weren’t freed)

This commit is contained in:
Michael Stapelberg 2009-06-11 03:30:42 +02:00
parent 55f0aa8f28
commit 70be57352c
1 changed files with 9 additions and 0 deletions

View File

@ -279,6 +279,15 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath)
REQUIRED_OPTION(terminal); REQUIRED_OPTION(terminal);
REQUIRED_OPTION(font); REQUIRED_OPTION(font);
while (!SLIST_EMPTY(&variables)) {
struct Variable *v = SLIST_FIRST(&variables);
SLIST_REMOVE_HEAD(&variables, variables);
free(v->key);
free(v->value);
free(v);
}
return; return;
} }