Fix some server context memory leaks.

This commit is contained in:
Jordan Bancino 2022-10-13 12:34:17 -04:00
parent 80366fc294
commit 65dad27902

View file

@ -126,11 +126,18 @@ HttpServerContextFree(HttpServerContext * c)
} }
HashMapFree(c->requestHeaders); 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); HashMapFree(c->responseHeaders);
Free(c->requestPath); Free(c->requestPath);
fclose(c->stream); fclose(c->stream);
Free(c);
} }
HashMap * HashMap *