From: Orestis Floros Date: Tue, 27 Mar 2018 00:36:54 +0000 (+0300) Subject: cmd_append_layout: resolve_tilde already allocates memory X-Git-Tag: 4.16~112^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e424a31307765b561b0d111bd355036fd5a1f61e;p=i3%2Fi3 cmd_append_layout: resolve_tilde already allocates memory Fixes a small memory leak with all append_layout commands. --- 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;