From b1d6c653514e582d963b5fd9b8ea591c0f8f37ad Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 11 Apr 2024 18:31:17 +0200 Subject: [PATCH 1/4] Cleanup curl pointer Signed-off-by: Jose Luis Rivero --- src/gz.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gz.cc b/src/gz.cc index cb2e2b19..ac8cbf7e 100644 --- a/src/gz.cc +++ b/src/gz.cc @@ -16,6 +16,7 @@ */ #include +#include #include #include @@ -138,6 +139,7 @@ extern "C" void uglyPrint( << std::string(encodedRes) << std::endl; } } + curl_easy_cleanup(curl); } ////////////////////////////////////////////////// From 1ff983fda799da1039e7a33a296240163ad5d0a5 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 11 Apr 2024 18:31:29 +0200 Subject: [PATCH 2/4] Do not duplicate version for gz_TEST Signed-off-by: Jose Luis Rivero --- src/gz_TEST.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gz_TEST.cc b/src/gz_TEST.cc index 815fa7f6..7485e648 100644 --- a/src/gz_TEST.cc +++ b/src/gz_TEST.cc @@ -47,7 +47,7 @@ std::string custom_exec_str(std::string _cmd) return result; } -auto g_version = std::string(strdup(GZ_FUEL_TOOLS_VERSION_FULL)); +auto g_version = std::string(GZ_FUEL_TOOLS_VERSION_FULL); auto g_exec = std::string(GZ_PATH); auto g_listCmd = g_exec + " fuel list -v 4 --force-version " + g_version; From 20f09da6e9fc8cdf9a8986e29d8b43637858cd92 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 11 Apr 2024 19:21:35 +0200 Subject: [PATCH 3/4] curl_free missing for decodedPath Signed-off-by: Jose Luis Rivero --- src/RestClient.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RestClient.cc b/src/RestClient.cc index 222f0c8f..bbcec0bb 100644 --- a/src/RestClient.cc +++ b/src/RestClient.cc @@ -223,6 +223,7 @@ RestResponse Rest::Request(HttpMethod _method, encodedPath = curl_easy_escape(curl, decodedPath, decodedSize); url = RestJoinUrl(url, encodedPath); + curl_free(decodedPath); } // Process query strings. From 661c071959c9b690cc25b434bc1775b4857be010 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 11 Apr 2024 19:41:36 +0200 Subject: [PATCH 4/4] Missing curl_free for encodedRes Signed-off-by: Jose Luis Rivero --- src/gz.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gz.cc b/src/gz.cc index ac8cbf7e..567de676 100644 --- a/src/gz.cc +++ b/src/gz.cc @@ -137,6 +137,7 @@ extern "C" void uglyPrint( std::cout << _serverConfig.Url().Str() << "/" << _serverConfig.Version() << "/" << owner->first << "/" << _resourceType << "/" << std::string(encodedRes) << std::endl; + curl_free(encodedRes); } } curl_easy_cleanup(curl);