fix a typo bug
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 12 May 2016 15:34:35 +0000 (17:34 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 12 May 2016 15:34:35 +0000 (17:34 +0200)
Change-Id: If622b8964d554469204f4df379680c2d258b4bff
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-ws-json1.c

index 67ce2d8..b6397af 100644 (file)
@@ -343,7 +343,7 @@ static void wsreq_addref(struct afb_wsreq *wsreq)
 static void wsreq_unref(struct afb_wsreq *wsreq)
 {
        if (--wsreq->refcount == 0) {
-               struct afb_wsreq **prv = &wsreq->ws->requests;
+               struct afb_wsreq **prv = &wsreq->aws->requests;
                while(*prv != NULL) {
                        if (*prv == wsreq) {
                                *prv = wsreq->next;
@@ -352,6 +352,7 @@ static void wsreq_unref(struct afb_wsreq *wsreq)
                        prv = &(*prv)->next;
                }
                afb_context_disconnect(&wsreq->context);
+               json_object_put(wsreq->root);
                free(wsreq->text);
                free(wsreq);
        }