From abe15012f3e153401045f6f426b80a9b7dd6feec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Mon, 12 Feb 2018 18:03:38 +0100 Subject: [PATCH] afb-stub-ws: Protect against self-destruction MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I43b15b8f675173a693816a0b8efd05fd024278f0 Signed-off-by: José Bollo --- src/afb-stub-ws.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/afb-stub-ws.c b/src/afb-stub-ws.c index 16475927..a8af53cc 100644 --- a/src/afb-stub-ws.c +++ b/src/afb-stub-ws.c @@ -651,10 +651,12 @@ static void on_hangup(void *closure) { struct afb_stub_ws *stubws = closure; + afb_stub_ws_addref(stubws); if (stubws->on_hangup) stubws->on_hangup(stubws); release_sessions(stubws); + afb_stub_ws_unref(stubws); } /*****************************************************/ -- 2.16.6