aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_attribute.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2020-12-27 21:43:47 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2020-12-27 21:43:47 +0900
commit7b32281b71e450827ff90f00451f5e5e98c0521e (patch)
treeda46c45025d48462e6d9139bf2fe5c407df95c32 /src/reclaim/reclaim_attribute.c
parent75a3a90fb765da872383b8f85b2d4087186dc3db (diff)
downloadgnunet-7b32281b71e450827ff90f00451f5e5e98c0521e.tar.gz
gnunet-7b32281b71e450827ff90f00451f5e5e98c0521e.zip
-hunting memleaks
Diffstat (limited to 'src/reclaim/reclaim_attribute.c')
-rw-r--r--src/reclaim/reclaim_attribute.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/reclaim/reclaim_attribute.c b/src/reclaim/reclaim_attribute.c
index 2217987ac..14690d7c9 100644
--- a/src/reclaim/reclaim_attribute.c
+++ b/src/reclaim/reclaim_attribute.c
@@ -102,6 +102,37 @@ init ()
102 NULL); 102 NULL);
103} 103}
104 104
105/**
106 * Dual function to #init().
107 */
108void __attribute__ ((destructor))
109RECLAIM_ATTRIBUTE_fini ()
110{
111 struct Plugin *plugin;
112 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
113 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
114
115 if (pd != dpd)
116 GNUNET_OS_init (dpd);
117
118 for (unsigned int i = 0; i < num_plugins; i++)
119 {
120 plugin = attr_plugins[i];
121 GNUNET_break (NULL ==
122 GNUNET_PLUGIN_unload (plugin->library_name,
123 plugin->api));
124 GNUNET_free (plugin->library_name);
125 GNUNET_free (plugin);
126 }
127 GNUNET_free (attr_plugins);
128
129 if (pd != dpd)
130 GNUNET_OS_init (pd);
131
132 attr_plugins = NULL;
133}
134
135
105 136
106/** 137/**
107 * Convert a type name to the corresponding number 138 * Convert a type name to the corresponding number