]> git.sur5r.net Git - i3/i3/commitdiff
cmd_append_layout: resolve_tilde already allocates memory 3205/head
authorOrestis Floros <orestisf1993@gmail.com>
Tue, 27 Mar 2018 00:36:54 +0000 (03:36 +0300)
committerOrestis Floros <orestisf1993@gmail.com>
Tue, 27 Mar 2018 00:37:57 +0000 (03:37 +0300)
Fixes a small memory leak with all append_layout commands.

src/commands.c

index 98625a911bd5b121a3b8574aef5e558ab0beef73..500a697eed194aec622d9b82e9f1394edd2169bf 100644 (file)
@@ -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;