diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-07-10 10:23:52 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-07-10 10:23:52 +0200 |
commit | 3024dc9fa54e8677b4816e56f8d215556a7d5561 (patch) | |
tree | aaf2281e1c69327d4b91565d3b75c0a6fa36165a /src/extensions/extensions.c | |
parent | 9d706a01a23e36e1c349d06e7a1be8bb44b7f0d5 (diff) |
fix memory leaks reported by valgrind
Diffstat (limited to 'src/extensions/extensions.c')
-rw-r--r-- | src/extensions/extensions.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/extensions/extensions.c b/src/extensions/extensions.c index 731ccfd08..fbbe874fb 100644 --- a/src/extensions/extensions.c +++ b/src/extensions/extensions.c @@ -184,7 +184,7 @@ configure_extension ( { struct LoadConfClosure *col = cls; const char *name; - char *lib_name; + char lib_name[1024] = {0}; struct TALER_Extension *extension; if (GNUNET_OK != col->error) @@ -199,17 +199,16 @@ configure_extension ( /* Load the extension library */ - GNUNET_asprintf (&lib_name, + GNUNET_snprintf (lib_name, + sizeof(lib_name), "libtaler_extension_%s", name); /* Lower-case extension name, config is case-insensitive */ for (unsigned int i = 0; i < strlen (lib_name); i++) - { lib_name[i] = tolower (lib_name[i]); - } - extension = GNUNET_PLUGIN_load ( - lib_name, - (void *) col->cfg); + + extension = GNUNET_PLUGIN_load (lib_name, + (void *) col->cfg); if (NULL == extension) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |