fix some memory leaks in dns handling.
authorbcook <bcook@openbsd.org>
Tue, 13 Jan 2015 02:28:56 +0000 (02:28 +0000)
committerbcook <bcook@openbsd.org>
Tue, 13 Jan 2015 02:28:56 +0000 (02:28 +0000)
commitc0cb3bf16c3e151fb4a734bceb763c8101081625
tree44e55b4290d767d4d1fad57b9a7fd03df3c64705
parent34116e973e3da3fcd4fc480e6d5da1c1c42dd6a6
fix some memory leaks in dns handling.

 - Nothing seems to free the result of host_dns(), so add host_dns_free() and
   call after each query.
 - If imsg_add() fails, it frees buf. Avoid subsequently dereferencing the
   freed buf in imsg_close().

ok millert@ deraadt@
usr.sbin/ntpd/config.c
usr.sbin/ntpd/ntp_dns.c
usr.sbin/ntpd/ntpd.c
usr.sbin/ntpd/ntpd.h