aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_credential.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_credential.c
parent75a3a90fb765da872383b8f85b2d4087186dc3db (diff)
downloadgnunet-7b32281b71e450827ff90f00451f5e5e98c0521e.tar.gz
gnunet-7b32281b71e450827ff90f00451f5e5e98c0521e.zip
-hunting memleaks
Diffstat (limited to 'src/reclaim/reclaim_credential.c')
-rw-r--r--src/reclaim/reclaim_credential.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/reclaim/reclaim_credential.c b/src/reclaim/reclaim_credential.c
index b85ba5955..05601c3d3 100644
--- a/src/reclaim/reclaim_credential.c
+++ b/src/reclaim/reclaim_credential.c
@@ -104,6 +104,38 @@ init ()
104 104
105 105
106/** 106/**
107 * Dual function to #init().
108 */
109void __attribute__ ((destructor))
110RECLAIM_CREDENTIAL_fini ()
111{
112 struct Plugin *plugin;
113 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
114 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
115
116 if (pd != dpd)
117 GNUNET_OS_init (dpd);
118
119 for (unsigned int i = 0; i < num_plugins; i++)
120 {
121 plugin = credential_plugins[i];
122 GNUNET_break (NULL ==
123 GNUNET_PLUGIN_unload (plugin->library_name,
124 plugin->api));
125 GNUNET_free (plugin->library_name);
126 GNUNET_free (plugin);
127 }
128 GNUNET_free (credential_plugins);
129
130 if (pd != dpd)
131 GNUNET_OS_init (pd);
132
133 credential_plugins = NULL;
134}
135
136
137
138/**
107 * Convert an credential type name to the corresponding number 139 * Convert an credential type name to the corresponding number
108 * 140 *
109 * @param typename name to convert 141 * @param typename name to convert