Browse Source

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

ichrispa 9 years ago
parent
commit
f86659cda8
1 changed files with 1 additions and 0 deletions
  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;