Fix a crash on disconnection
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 11 Apr 2017 12:15:55 +0000 (14:15 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Tue, 11 Apr 2017 12:15:55 +0000 (14:15 +0200)
Change-Id: Ib3654ac8125b040f8264524e7c821a6559f627cd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-ws-json1.c

index 29078e2..9d560c5 100644 (file)
@@ -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");
 }