Update copyright date
[src/app-framework-binder.git] / src / afb-evt.c
index ed3e467..87fce5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2018 "IoT.bzh"
+ * Copyright (C) 2015-2019 "IoT.bzh"
  * Author José Bollo <jose.bollo@iot.bzh>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -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);