Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/iotbzh/afb-daemon
[src/app-framework-binder.git]
/
src
/
afb-ws-json1.c
diff --git
a/src/afb-ws-json1.c
b/src/afb-ws-json1.c
index
05c19e7
..
fe7514d
100644
(file)
--- 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 <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author: José Bollo <jose.bollo@iot.bzh>
*
* 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) {
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);
afb_context_disconnect(&wsreq->context);
+ json_object_put(wsreq->root);
free(wsreq->text);
free(wsreq);
}
free(wsreq->text);
free(wsreq);
}