From a274ae1502b257511298bd6a01cf1b7b69ade468 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Tue, 11 Apr 2017 14:15:55 +0200 Subject: [PATCH] Fix a crash on disconnection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ib3654ac8125b040f8264524e7c821a6559f627cd Signed-off-by: José Bollo --- src/afb-ws-json1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/afb-ws-json1.c b/src/afb-ws-json1.c index 29078e26..9d560c5a 100644 --- a/src/afb-ws-json1.c +++ b/src/afb-ws-json1.c @@ -231,9 +231,10 @@ static struct json_object *wsreq_json(struct afb_wsreq *wsreq) static void wsreq_reply(struct afb_wsreq *wsreq, int iserror, json_object *obj) { int rc; + rc = (iserror ? afb_wsj1_reply_error_j : afb_wsj1_reply_ok_j)( wsreq->msgj1, obj, afb_context_sent_token(&wsreq->xreq.context)); if (rc) - ERROR("Can't send reply: %m (was %s)", json_object_get_string(obj)); + ERROR("Can't send reply: %m"); } -- 2.16.6