]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: close only client socket when destroying NCR instance
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Apr 2014 15:25:28 +0000 (17:25 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Apr 2014 15:50:24 +0000 (17:50 +0200)
ntp_core.c

index bea86a6e90b1b93e263d04a34a4df8624f565f39..8933c496ffff3edd48219e4d6400a7ceb51b6962 100644 (file)
@@ -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);