From e92021e0c925e20bdfe3f94eeb19f0f0eb6c5f7d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 18 Aug 2023 18:13:19 -0700 Subject: [PATCH] config: repeatablestring must copy values it parses into arena --- src/config.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.zig b/src/config.zig index 773017a9a..a39e29814 100644 --- a/src/config.zig +++ b/src/config.zig @@ -1176,7 +1176,8 @@ pub const RepeatableString = struct { pub fn parseCLI(self: *Self, alloc: Allocator, input: ?[]const u8) !void { const value = input orelse return error.ValueRequired; - try self.list.append(alloc, value); + const copy = try alloc.dupe(u8, value); + try self.list.append(alloc, copy); } /// Deep copy of the struct. Required by Config.