]> git.ipfire.org Git - thirdparty/chrony.git/commit
ntp: fix finalization for async resolver
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 22 Aug 2024 07:26:59 +0000 (09:26 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 22 Aug 2024 07:32:36 +0000 (09:32 +0200)
commit08b67dba98b5dbc0184c38b3c1963dd2f00d2bd9
tree842fed324c6cf94c3a8d270e4260f84723005829
parent61f15fedcd75cdb4cdc6a8eaa676e924779cd461
ntp: fix finalization for async resolver

If an attempt to resolve addresses of an NTP server is made right before
starting the termination sequence, the asynchronous resolver thread
could read the server name when it was already freed.

Leave unresolved sources allocated in NSR_Finalise() if the async
resolver did not finish yet, at least for now. Waiting for the resolving
result or cancelling the thread would complicate the code. The scheduler
is not expected to be running at this point.
ntp_sources.c