diff seobeo/s_http_client.c @ 168:f3084bca7317

[Misc] Fixed all errors and all tests should pass now.
author MrJuneJune <me@mrjunejune.com>
date Mon, 19 Jan 2026 16:29:02 -0800
parents 058de208e640
children 71ad34a8bc9a
line wrap: on
line diff
--- a/seobeo/s_http_client.c	Mon Jan 19 16:28:45 2026 -0800
+++ b/seobeo/s_http_client.c	Mon Jan 19 16:29:02 2026 -0800
@@ -541,11 +541,10 @@
   if (p_req->p_arena)
     Dowa_Arena_Free(p_req->p_arena);
 
-  if (p_req->headers_map)
-    Dowa_HashMap_Free(p_req->headers_map);
-
-  if (p_req->headers_array)
-    Dowa_Array_Free(p_req->headers_array);
+  // Note: headers_map and headers_array are allocated using arena functions
+  // (Dowa_HashMap_Push_Arena, Dowa_Array_Push_Arena), so they are freed
+  // when the arena is freed above. Do not call Dowa_HashMap_Free or
+  // Dowa_Array_Free on them.
 
   free(p_req);
 }
@@ -558,8 +557,8 @@
   if (p_resp->p_arena)
     Dowa_Arena_Free(p_resp->p_arena);
 
-  if (p_resp->headers)
-    Dowa_HashMap_Free(p_resp->headers);
+  // Note: headers are allocated using Dowa_HashMap_Push_Arena, so they are
+  // freed when the arena is freed above. Do not call Dowa_HashMap_Free.
 
   free(p_resp);
 }