From: José Bollo Date: Mon, 12 Feb 2018 17:03:38 +0000 (+0100) Subject: afb-stub-ws: Protect against self-destruction X-Git-Tag: flounder_5.99.1~76 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=abe15012f3e153401045f6f426b80a9b7dd6feec afb-stub-ws: Protect against self-destruction Change-Id: I43b15b8f675173a693816a0b8efd05fd024278f0 Signed-off-by: José Bollo --- 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); } /*****************************************************/