Browse Source

Client: Remove pointer to the connection context during shutdown

Julius Pfrommer 5 years ago
parent
commit
1bd77be828
1 changed files with 3 additions and 2 deletions
  1. 3 2
      arch/ua_network_tcp.c

+ 3 - 2
arch/ua_network_tcp.c

@@ -570,11 +570,12 @@ ClientNetworkLayerTCP_close(UA_Connection *connection) {
 
 static void
 ClientNetworkLayerTCP_free(UA_Connection *connection) {
-    if (connection->handle){
+    if(connection->handle) {
         TCPClientConnection *tcpConnection = (TCPClientConnection *)connection->handle;
         if(tcpConnection->server)
-          UA_freeaddrinfo(tcpConnection->server);
+            UA_freeaddrinfo(tcpConnection->server);
         UA_free(tcpConnection);
+        connection->handle = NULL;
     }
 }