aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-stub-ws.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-02-12 18:03:38 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-02-13 09:20:24 +0100
commitabe15012f3e153401045f6f426b80a9b7dd6feec (patch)
treeef4678e276525aecfec9c6935db3851de0ac6320 /src/afb-stub-ws.c
parentfb678ae817f739d9c7208f9165f6c04b2028af26 (diff)
afb-stub-ws: Protect against self-destruction
Change-Id: I43b15b8f675173a693816a0b8efd05fd024278f0 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-stub-ws.c')
-rw-r--r--src/afb-stub-ws.c2
1 files changed, 2 insertions, 0 deletions
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);
}
/*****************************************************/