From 84abdfaced81f85f90a49dd184a5e923ac5e2f13 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 12 Jan 2023 15:34:39 +0100 Subject: [PATCH] command/layout: fix a memory leak --- river/command/layout.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/river/command/layout.zig b/river/command/layout.zig index 4ba4f19..e0967c9 100644 --- a/river/command/layout.zig +++ b/river/command/layout.zig @@ -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(); }