From e7525559693e17bea26df4693dabdeebe25df681 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 9 Aug 2021 16:48:51 +0200 Subject: [PATCH] config: fix leak of default layout namespace --- river/command/layout.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/river/command/layout.zig b/river/command/layout.zig index da67e82..f75a7ab 100644 --- a/river/command/layout.zig +++ b/river/command/layout.zig @@ -48,7 +48,10 @@ pub fn defaultLayout( if (args.len < 2) return Error.NotEnoughArguments; if (args.len > 2) return Error.TooManyArguments; + const old_default_layout_namespace = server.config.default_layout_namespace; server.config.default_layout_namespace = try util.gpa.dupe(u8, args[1]); + util.gpa.free(old_default_layout_namespace); + var it = server.root.all_outputs.first; while (it) |node| : (it = node.next) { const output = node.data;