]> git.sur5r.net Git - i3/i3/commitdiff
Fix memleak in config parsing (variables weren’t freed)
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 11 Jun 2009 01:30:42 +0000 (03:30 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 11 Jun 2009 01:30:42 +0000 (03:30 +0200)
src/config.c

index a9e90ab3b56f5bb7e2b0677d60e723d918d67122..5d6312edfb3c69ac57414c745b6dcfaad428f10d 100644 (file)
@@ -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;
 }