X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=blobdiff_plain;f=src%2Fafb-proto-ws.c;h=86112a323eea2349f0b7740c06af7be116e72920;hp=89d4522c1ad4781671460c30a2cf3c9da16d2df4;hb=7b6940f1524cac6172e71529a989424ff18fb850;hpb=9490a0a5fe69f54aa30c4f75a79acde9d06a80f1 diff --git a/src/afb-proto-ws.c b/src/afb-proto-ws.c index 89d4522c..86112a32 100644 --- a/src/afb-proto-ws.c +++ b/src/afb-proto-ws.c @@ -1022,7 +1022,7 @@ struct afb_proto_ws *afb_proto_ws_create_server(struct fdev *fdev, const struct void afb_proto_ws_unref(struct afb_proto_ws *protows) { - if (!__atomic_sub_fetch(&protows->refcount, 1, __ATOMIC_RELAXED)) { + if (protows && !__atomic_sub_fetch(&protows->refcount, 1, __ATOMIC_RELAXED)) { afb_proto_ws_hangup(protows); afb_ws_destroy(protows->ws); pthread_mutex_destroy(&protows->mutex);