浏览代码

Added safeguard against being called with a NULL-Pointer channel in detachSession().

ichrispa 10 年之前
父节点
当前提交
f86659cda8
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/ua_session.c

+ 1 - 0
src/ua_session.c

@@ -119,6 +119,7 @@ void UA_SecureChannel_detachSession(UA_SecureChannel *channel) {
         uatomic_cmpxchg(&session->channel, channel, UA_NULL);
     uatomic_set(&channel->session, UA_NULL);
 #else
+    if(channel == NULL) return;
     if(channel->session)
         channel->session->channel = UA_NULL;
     channel->session = UA_NULL;