diff --git a/ntp_core.c b/ntp_core.c index bea86a6..8933c49 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -395,7 +395,8 @@ NCR_DestroyInstance(NCR_Instance instance) instance->timer_running = 0; } - NIO_CloseClientSocket(instance->local_addr.sock_fd); + if (instance->mode == MODE_CLIENT) + NIO_CloseClientSocket(instance->local_addr.sock_fd); /* Free the data structure */ Free(instance);