From 0e034a20643ac8ff3f424588ad0b1757a632536a Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Thu, 17 Nov 2022 20:11:23 -0800 Subject: [PATCH] Fix double free --- src/http/headers.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/http/headers.zig b/src/http/headers.zig index a0bebea..8b8100b 100644 --- a/src/http/headers.zig +++ b/src/http/headers.zig @@ -103,7 +103,8 @@ pub const Fields = struct { errdefer self.allocator.free(val_clone); if (try self.unmanaged.fetchPut(self.allocator, key_clone, val_clone)) |entry| { - self.allocator.free(entry.key); + self.allocator.free(key_clone); + //self.allocator.free(entry.key); self.allocator.free(entry.value); } } @@ -123,8 +124,8 @@ pub const Fields = struct { } pub const CookieOptions = struct { - Secure: bool = false, - HttpOnly: bool = false, + Secure: bool = true, + HttpOnly: bool = true, SameSite: ?enum { Strict, Lax,