Move the log-forwarded proxies cleanup from global deinit() function into
log dedicated deinit function.
No backport needed.
free_proxy(p0);
}/* end while(p) */
- /* we don't need to free sink_proxies_list proxies since it is
- * already handled in sink_deinit()
+ /* we don't need to free sink_proxies_list nor cfg_log_forward proxies since
+ * they are respectively cleaned up in sink_deinit() and deinit_log_forward()
*/
- p = cfg_log_forward;
- /* we need to manually clean cfg_log_forward proxy list */
- while (p) {
- p0 = p;
- p = p->next;
- free_proxy(p0);
- }
/* destroy all referenced defaults proxies */
proxy_destroy_all_unref_defaults();
logline_rfc5424 = NULL;
}
+/* Deinitialize log forwarder proxies used for syslog messages */
+void deinit_log_forward()
+{
+ struct proxy *p, *p0;
+
+ p = cfg_log_forward;
+ /* we need to manually clean cfg_log_forward proxy list */
+ while (p) {
+ p0 = p;
+ p = p->next;
+ free_proxy(p0);
+ }
+}
+
/* Builds a log line in <dst> based on <list_format>, and stops before reaching
* <maxsize> characters. Returns the size of the output string in characters,
* not counting the trailing zero which is always added if the resulting size
REGISTER_PER_THREAD_ALLOC(init_log_buffers);
REGISTER_PER_THREAD_FREE(deinit_log_buffers);
+REGISTER_POST_DEINIT(deinit_log_forward);
+
/*
* Local variables:
* c-indent-level: 8