From d3e3339a05ab9ade1c7ef172df9b9d45428bb2bf Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 31 Jul 2011 17:11:51 +0200 Subject: [PATCH] Bugfix: Fix small memory leak when initializing output Cons --- src/randr.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.5