X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-stub-ws.c;h=c334fe158263ef77603639e6a7624f2aafe16f46;hb=refs%2Ftags%2Fflounder_6.0.5;hp=9bc52044c0d46a1d68f4e09baef1186cb98cf19c;hpb=74f381d988cd04707c2044ca2a201ad8bf87a6f3;p=src%2Fapp-framework-binder.git diff --git a/src/afb-stub-ws.c b/src/afb-stub-ws.c index 9bc52044..c334fe15 100644 --- a/src/afb-stub-ws.c +++ b/src/afb-stub-ws.c @@ -265,6 +265,7 @@ static void client_api_call_cb(void * closure, struct afb_xreq *xreq) return; } + afb_xreq_unhooked_addref(xreq); rc = afb_proto_ws_client_call( proto, xreq->request.called_verb, @@ -272,10 +273,10 @@ static void client_api_call_cb(void * closure, struct afb_xreq *xreq) afb_session_uuid(xreq->context.session), xreq, xreq_on_behalf_cred_export(xreq)); - if (rc >= 0) - afb_xreq_unhooked_addref(xreq); - else + if (rc < 0) { afb_xreq_reply(xreq, NULL, "internal", "can't send message"); + afb_xreq_unhooked_unref(xreq); + } } static void client_on_description_cb(void *closure, struct json_object *data)