aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-websock.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-03-15 15:34:59 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-03-16 16:27:01 +0100
commit428dd77c7ef528dd1769d7c9bb95cd0fb2eaf2a8 (patch)
treec693d6451e8c26332d732c1aabdb846113f425bd /src/afb-websock.c
parent1fca4b9b36dc1bb3c5ee7ec1ce6b5d74ffbfe29c (diff)
afb-websock: Fix a double free
The commit 0ebdff94d461abd4328cf45a6281c15139a045eb of libmicrohttpd fixed a bug but introduced a double free of hreq resource attached to the connection. That commit is between versions 0.9.59 and 0.9.60 of libmicrohttpd. Now, hreq is freed in 'end_handler' of afb-hsrv.c Change-Id: Ia865d65c5f9ef5ce787eb6545802ac8ea37ae468 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-websock.c')
-rw-r--r--src/afb-websock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/afb-websock.c b/src/afb-websock.c
index fdfca9d7..51234378 100644
--- a/src/afb-websock.c
+++ b/src/afb-websock.c
@@ -158,7 +158,9 @@ static void upgrade_to_websocket(
close_websocket(urh);
}
}
+#if MHD_VERSION <= 0x00095900
afb_hreq_unref(memo->hreq);
+#endif
free(memo);
}