balabit/syslog-ng — pull request #34 by algernon (2013-12-09 11:43:59+00:00)
Title: mainloop: Deinit the dns thread cache when reverting the config

When reloading the configuration and the new config fails to initialize,
syslog-ng reverts to the old config. But by that time,
dns_cache_thread_init() has already been called (when trying to init the
new config), and dns_cache_thread_deinit() never got called. So when we
tried to cfg_init() the old config, it called dns_cache_thread_init()
again, and triggered an assertion.

To remedy the issue in a nice way, this patch introduces cfg_reinit(),
which deinits the dns thread cache, and calls cfg_init() after. This is
to avoid littering mainloop with calls to dns_cache_thread_*().

Reported-by: Andras Mitzki
Signed-off-by: Gergely Nagy