From 6aa95090b14992d23d36b4e0247bcc265becf732 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sat, 14 Jan 2017 22:21:44 +0200 Subject: [PATCH] do not leak memory on exit --- src/backends.c | 1 - src/health.c | 1 - src/plugin_checks.c | 1 - src/plugin_freebsd.c | 1 - src/plugin_idlejitter.c | 1 - src/plugin_macos.c | 1 - src/plugin_nfacct.c | 1 - src/plugin_proc.c | 1 - src/plugin_proc_diskspace.c | 1 - src/plugin_tc.c | 1 - src/plugins_d.c | 1 - src/sys_fs_cgroup.c | 3 --- src/web_server.c | 2 -- 13 files changed, 16 deletions(-) diff --git a/src/backends.c b/src/backends.c index 59afa85d..1272d047 100644 --- a/src/backends.c +++ b/src/backends.c @@ -544,7 +544,6 @@ cleanup: info("BACKEND thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/health.c b/src/health.c index 5469c30e..ebd3ff61 100755 --- a/src/health.c +++ b/src/health.c @@ -3115,7 +3115,6 @@ void *health_main(void *ptr) { info("HEALTH thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_checks.c b/src/plugin_checks.c index f39a6210..fcc542e6 100644 --- a/src/plugin_checks.c +++ b/src/plugin_checks.c @@ -80,7 +80,6 @@ void *checks_main(void *ptr) { info("CHECKS thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_freebsd.c b/src/plugin_freebsd.c index a9a9d643..bdc3599e 100644 --- a/src/plugin_freebsd.c +++ b/src/plugin_freebsd.c @@ -59,7 +59,6 @@ void *freebsd_main(void *ptr) { info("FREEBSD thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_idlejitter.c b/src/plugin_idlejitter.c index dbfea2e6..7d4a4c18 100644 --- a/src/plugin_idlejitter.c +++ b/src/plugin_idlejitter.c @@ -50,7 +50,6 @@ void *cpuidlejitter_main(void *ptr) { info("IDLEJITTER thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_macos.c b/src/plugin_macos.c index 726d5b73..3955c141 100644 --- a/src/plugin_macos.c +++ b/src/plugin_macos.c @@ -79,7 +79,6 @@ void *macos_main(void *ptr) { info("MACOS thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_nfacct.c b/src/plugin_nfacct.c index 67dccb6b..7aae33c0 100644 --- a/src/plugin_nfacct.c +++ b/src/plugin_nfacct.c @@ -190,7 +190,6 @@ cleanup: if(nl) mnl_socket_close(nl); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_proc.c b/src/plugin_proc.c index b02e483c..bf0e6fb0 100644 --- a/src/plugin_proc.c +++ b/src/plugin_proc.c @@ -148,7 +148,6 @@ void *proc_main(void *ptr) { info("PROC thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_proc_diskspace.c b/src/plugin_proc_diskspace.c index f8b6c814..eb6da1f3 100644 --- a/src/plugin_proc_diskspace.c +++ b/src/plugin_proc_diskspace.c @@ -280,7 +280,6 @@ void *proc_diskspace_main(void *ptr) { info("DISKSPACE thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugin_tc.c b/src/plugin_tc.c index 83ab2373..dd4a3d27 100644 --- a/src/plugin_tc.c +++ b/src/plugin_tc.c @@ -1016,7 +1016,6 @@ cleanup: info("TC thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/plugins_d.c b/src/plugins_d.c index d7ea698e..4b2bdc8d 100644 --- a/src/plugins_d.c +++ b/src/plugins_d.c @@ -542,7 +542,6 @@ cleanup: info("PLUGINS.D thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/sys_fs_cgroup.c b/src/sys_fs_cgroup.c index 54a818a4..1eb3b7dd 100644 --- a/src/sys_fs_cgroup.c +++ b/src/sys_fs_cgroup.c @@ -89,14 +89,12 @@ void read_cgroup_plugin_configuration() { " *.slice " " *.user " " *.mount " - " *.service " " *.partition " " */ns " // lxc/*/ns #1397 ), NETDATA_SIMPLE_PATTERN_MODE_EXACT); disabled_cgroup_paths = netdata_simple_pattern_list_create( config_get("plugin:cgroups", "disable by default cgroup paths matching", - " system.slice " " system " " systemd " " user.slice " @@ -1510,7 +1508,6 @@ void *cgroups_main(void *ptr) { info("CGROUP thread exiting"); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } diff --git a/src/web_server.c b/src/web_server.c index 1b4be97b..8e942a59 100644 --- a/src/web_server.c +++ b/src/web_server.c @@ -473,7 +473,6 @@ void *socket_listen_main_multi_threaded(void *ptr) { freez(fds); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } @@ -644,7 +643,6 @@ void *socket_listen_main_single_threaded(void *ptr) { close_listen_sockets(); static_thread->enabled = 0; - static_thread->thread = NULL; pthread_exit(NULL); return NULL; } -- 2.39.2