config: fix leak of default layout namespace

This commit is contained in:
Isaac Freund 2021-08-09 16:48:51 +02:00
parent 7013bc3b69
commit e752555969
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

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