cmd_append_layout: resolve_tilde already allocates memory

Fixes a small memory leak with all append_layout commands.
next
Orestis Floros 2018-03-27 03:36:54 +03:00
parent 6f4b0e1fdd
commit e424a31307
No known key found for this signature in database
GPG Key ID: E9AD9F32E401E38F
1 changed files with 2 additions and 3 deletions

View 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;