X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-ws-json1.c;h=fe7514d92a44990b5b432cad02656c20685aeccd;hb=c7e9786d408f13d8f8f43c6b68da916bbb1ed5f3;hp=05c19e7d84aab2f68f0f938aae77198dfabbc573;hpb=7a31f839633c9192c98be1061792b8482f181990;p=src%2Fapp-framework-binder.git diff --git a/src/afb-ws-json1.c b/src/afb-ws-json1.c index 05c19e7d..fe7514d9 100644 --- a/src/afb-ws-json1.c +++ b/src/afb-ws-json1.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 IoT.bzh + * Copyright (C) 2016 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -343,7 +343,16 @@ 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->aws->requests; + while(*prv != NULL) { + if (*prv == wsreq) { + *prv = wsreq->next; + break; + } + prv = &(*prv)->next; + } afb_context_disconnect(&wsreq->context); + json_object_put(wsreq->root); free(wsreq->text); free(wsreq); }