Check if NULL sock->user_data when closing connection after
authorPekka Riikonen <priikone@silcnet.org>
Wed, 3 Mar 2004 14:13:36 +0000 (14:13 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 3 Mar 2004 14:13:36 +0000 (14:13 +0000)
calling protocol completion in connection closing (it might
be closed in the completion).

apps/silcd/server.c

index bec50d7df2f9bd15969bc6305ac7f2d829dab987..fb4a68dcd1416a1227c2e91ce666b90702e59a2a 100644 (file)
@@ -3412,6 +3412,8 @@ void silc_server_free_sock_user_data(SilcServer server,
     sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
     silc_protocol_execute_final(sock->protocol, server->schedule);
     sock->protocol = NULL;
+    if (!sock->user_data)
+      return;
   }
 
   switch (sock->type) {