소스 검색

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;