From 3217421797b873fd02393489d8af36744ba5132a Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 10 Apr 2014 17:25:28 +0200 Subject: [PATCH] ntp: close only client socket when destroying NCR instance --- ntp_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);