Skip to content

Commit

Permalink
command/layout: fix a memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
ifreund committed Jan 12, 2023
1 parent 615beab commit 84abdfa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions river/command/layout.zig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ pub fn outputLayout(
if (args.len > 2) return Error.TooManyArguments;

const output = seat.focused_output;
const old_layout_namespace = output.layout_namespace;
output.layout_namespace = try util.gpa.dupe(u8, args[1]);
if (old_layout_namespace) |old| util.gpa.free(old);
output.handleLayoutNamespaceChange();
}

Expand Down

0 comments on commit 84abdfa

Please sign in to comment.