From: Michael Stapelberg Date: Thu, 11 Jun 2009 01:30:42 +0000 (+0200) Subject: Fix memleak in config parsing (variables weren’t freed) X-Git-Tag: 3.b~65 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=70be57352ce77a86eafb1270d6f6e4bbf19a40e9;p=i3%2Fi3 Fix memleak in config parsing (variables weren’t freed) --- diff --git a/src/config.c b/src/config.c index a9e90ab3..5d6312ed 100644 --- a/src/config.c +++ b/src/config.c @@ -279,6 +279,15 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath) REQUIRED_OPTION(terminal); 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; }