diff --git a/src/config/Config.zig b/src/config/Config.zig index 6ca64ca01..eb4f21d18 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -2498,9 +2498,14 @@ pub const RepeatableString = struct { /// Deep copy of the struct. Required by Config. pub fn clone(self: *const Self, alloc: Allocator) !Self { - return .{ - .list = try self.list.clone(alloc), - }; + // Copy the list and all the strings in the list. + const list = try self.list.clone(alloc); + for (list.items) |*item| { + const copy = try alloc.dupeZ(u8, item.*); + item.* = copy; + } + + return .{ .list = list }; } /// The number of itemsin the list