ntp: improve NTS check in NAU_DestroyInstance()

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).
This commit is contained in:
Miroslav Lichvar 2020-09-23 14:59:22 +02:00
parent 35b3a42ed9
commit 59ad433b6b

View file

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