summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-09-11 17:50:13 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-09-11 17:57:00 +0200
commitc65113c390a5337924729e21f74f45df8c109291 (patch)
tree613607f63e5079df1ebc522ec4bc53e7cb4e3f96
parentba58e7ffa5c36300d09165253c58f25add228273 (diff)
afb-hreq: Fix a leak on websocket upgrade
A 'no-reply' answer was created but not emitted nor freed when http connection was upgraded to websocket. Merging replied and xreq.replied was a possible solution but I wanted not change much things. Change-Id: I86c6c7ee52f69d50732e50fa6594f1d22d77ddfd Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-hreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/afb-hreq.c b/src/afb-hreq.c
index 9c630912..dc02e6fe 100644
--- a/src/afb-hreq.c
+++ b/src/afb-hreq.c
@@ -330,6 +330,8 @@ void afb_hreq_addref(struct afb_hreq *hreq)
void afb_hreq_unref(struct afb_hreq *hreq)
{
+ if (hreq->replied)
+ hreq->xreq.replied = 1;
afb_xreq_unref(&hreq->xreq);
}