X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-proto-ws.c;h=86112a323eea2349f0b7740c06af7be116e72920;hb=e11e8fbe65c6d57716c96bc6dd2b503a310dca67;hp=89d4522c1ad4781671460c30a2cf3c9da16d2df4;hpb=e36f8d572ca660f5c06fe45297d13c7a6818cc65;p=src%2Fapp-framework-binder.git 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);