diff options
author | Jose Bollo <jose.bollo@iot.bzh> | 2018-08-20 17:30:55 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2018-08-23 10:18:18 +0200 |
commit | 7b6940f1524cac6172e71529a989424ff18fb850 (patch) | |
tree | a2ec397272c66f07ed0089bb23762c3c5e4a0560 /src/afb-evt.c | |
parent | 9490a0a5fe69f54aa30c4f75a79acde9d06a80f1 (diff) |
afb-stub-ws: Safe handling of deconnections
This commit also include many comments and
improvements in naming of functions.
Bug-AGL: SPEC-1668
Change-Id: I1b5dd95678d94e9edfca1c598c5697e90bb9e5bf
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-evt.c')
-rw-r--r-- | src/afb-evt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/afb-evt.c b/src/afb-evt.c index ed3e4672..e06d06e1 100644 --- a/src/afb-evt.c +++ b/src/afb-evt.c @@ -537,7 +537,7 @@ void afb_evt_listener_unref(struct afb_evt_listener *listener) struct afb_evt_listener **prv; struct afb_evtid *evtid; - if (!__atomic_sub_fetch(&listener->refcount, 1, __ATOMIC_RELAXED)) { + if (listener && !__atomic_sub_fetch(&listener->refcount, 1, __ATOMIC_RELAXED)) { /* unlink the listener */ pthread_rwlock_wrlock(&listeners_rwlock); |