From 65dad279024e03ae688a5738534894c040628abb Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Thu, 13 Oct 2022 12:34:17 -0400 Subject: [PATCH] Fix some server context memory leaks. --- src/HttpServer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/HttpServer.c b/src/HttpServer.c index 7bbbd09..e0f3f10 100644 --- a/src/HttpServer.c +++ b/src/HttpServer.c @@ -126,11 +126,18 @@ HttpServerContextFree(HttpServerContext * c) } HashMapFree(c->requestHeaders); - /* It is up to the handler to free its values */ + while (HashMapIterate(c->responseHeaders, &key, &val)) + { + Free(key); + Free(val); + } + HashMapFree(c->responseHeaders); Free(c->requestPath); fclose(c->stream); + + Free(c); } HashMap *