/* If there is pending outgoing data for the client then purge it
to the network before removing the client entry. */
- if (SILC_IS_OUTBUF_PENDING(sock) && (SILC_IS_DISCONNECTED(sock) == FALSE)) {
+ if (sock && SILC_IS_OUTBUF_PENDING(sock) &&
+ (SILC_IS_DISCONNECTED(sock) == FALSE)) {
server->stat.packets_sent++;
if (sock->outbuf->data - sock->outbuf->head)