Be sure to invoke *lws_free_header_table*:
* Just prior to freeing a session
* When allocating a new header table
This prevents some memory leaks we've found.
diff --git a/lib/parsers.c b/lib/parsers.c
index 7dd24fe..195325b 100644
--- a/lib/parsers.c
+++ b/lib/parsers.c
@@ -61,6 +61,8 @@
int lws_allocate_header_table(struct libwebsocket *wsi)
{
+ /* Be sure to free any existing header data to avoid mem leak: */
+ lws_free_header_table(wsi);
wsi->u.hdr.ah = malloc(sizeof(*wsi->u.hdr.ah));
if (wsi->u.hdr.ah == NULL) {
lwsl_err("Out of memory\n");