From e424a31307765b561b0d111bd355036fd5a1f61e Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Tue, 27 Mar 2018 03:36:54 +0300 Subject: [PATCH] cmd_append_layout: resolve_tilde already allocates memory Fixes a small memory leak with all append_layout commands. --- src/commands.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commands.c b/src/commands.c index 98625a91..500a697e 100644 --- a/src/commands.c +++ b/src/commands.c @@ -789,11 +789,10 @@ void cmd_nop(I3_CMD, const char *comment) { * */ void cmd_append_layout(I3_CMD, const char *cpath) { - char *path = sstrdup(cpath); - LOG("Appending layout \"%s\"\n", path); + LOG("Appending layout \"%s\"\n", cpath); /* Make sure we allow paths like '~/.i3/layout.json' */ - path = resolve_tilde(path); + char *path = resolve_tilde(cpath); char *buf = NULL; ssize_t len; -- 2.39.2