config: repeatablestring must copy values it parses into arena

This commit is contained in:
Mitchell Hashimoto
2023-08-18 18:13:19 -07:00
parent fe3c82d81a
commit e92021e0c9

View File

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