From 3024dc9fa54e8677b4816e56f8d215556a7d5561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Mon, 10 Jul 2023 10:23:52 +0200 Subject: fix memory leaks reported by valgrind --- src/extensions/extensions.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/extensions') 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, -- cgit v1.2.3