From: Michael Stapelberg Date: Sun, 31 Jul 2011 15:11:51 +0000 (+0200) Subject: Bugfix: Fix small memory leak when initializing output Cons X-Git-Tag: 4.0~14^2~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d3e3339a05ab9ade1c7ef172df9b9d45428bb2bf;p=i3%2Fi3 Bugfix: Fix small memory leak when initializing output Cons --- diff --git a/src/randr.c b/src/randr.c index bdd55365..e57549b7 100644 --- a/src/randr.c +++ b/src/randr.c @@ -223,6 +223,7 @@ void output_init_con(Output *output) { match->insert_where = M_BELOW; TAILQ_INSERT_TAIL(&(topdock->swallow_head), match, matches); + FREE(topdock->name); topdock->name = sstrdup("topdock"); asprintf(&name, "[i3 con] top dockarea %s", con->name); @@ -236,6 +237,7 @@ void output_init_con(Output *output) { DLOG("adding main content container\n"); Con *content = con_new(NULL, NULL); content->type = CT_CON; + FREE(content->name); content->name = sstrdup("content"); asprintf(&name, "[i3 con] content %s", con->name); @@ -255,6 +257,7 @@ void output_init_con(Output *output) { match->insert_where = M_BELOW; TAILQ_INSERT_TAIL(&(bottomdock->swallow_head), match, matches); + FREE(bottomdock->name); bottomdock->name = sstrdup("bottomdock"); asprintf(&name, "[i3 con] bottom dockarea %s", con->name);