]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: improve NTS check in NAU_DestroyInstance()
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Sep 2020 12:59:22 +0000 (14:59 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 23 Sep 2020 13:10:37 +0000 (15:10 +0200)
Check the mode instead of the nts pointer to make it clear the pointer
is not expected to be NULL in an NTS instance (unless the NTS support is
stubbed).

ntp_auth.c

index 7a8b4afd8cf39059848739d8bc931a2d0d8f2e78..ee0611cc41cf883f670e903b639f53b8fdce3f22 100644 (file)
@@ -175,7 +175,7 @@ NAU_CreateNtsInstance(IPSockAddr *nts_address, const char *name, const IPSockAdd
 void
 NAU_DestroyInstance(NAU_Instance instance)
 {
-  if (instance->nts)
+  if (instance->mode == NTP_AUTH_NTS)
     NNC_DestroyInstance(instance->nts);
   Free(instance);
 }