aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-02-13 10:26:26 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-02-13 10:56:14 +0100
commit32644e4d8f5413220b6393577ff4790225da6133 (patch)
treec0adac40cfb12fb66bd380d3497b19b24fd573c1
parentabe15012f3e153401045f6f426b80a9b7dd6feec (diff)
afb-stub-ws: Fix segfault on diconection
Change-Id: I7826b86e4d4cc921b2daaca5c8dda0fd27faae10 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-stub-ws.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/afb-stub-ws.c b/src/afb-stub-ws.c
index a8af53cc..036b4943 100644
--- a/src/afb-stub-ws.c
+++ b/src/afb-stub-ws.c
@@ -709,7 +709,8 @@ void afb_stub_ws_unref(struct afb_stub_ws *stubws)
{
if (!__atomic_sub_fetch(&stubws->refcount, 1, __ATOMIC_RELAXED)) {
drop_all_events(stubws);
- afb_evt_listener_unref(stubws->listener);
+ if (stubws->listener)
+ afb_evt_listener_unref(stubws->listener);
release_sessions(stubws);
afb_proto_ws_unref(stubws->proto);
afb_cred_unref(stubws->cred);