From 5251b3df104c0bb210c88bd935a7cc1fd41e4537 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: ćšć, 20 5æ 2021 11:02:42 +0800 Subject: [PATCH] Merge branch 'develop' of https://github.com/open-license-manager/open-license-manager into develop --- src/library/locate/EnvironmentVarData.cpp | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/library/locate/EnvironmentVarData.cpp b/src/library/locate/EnvironmentVarData.cpp index 0162dbe..cc6e650 100644 --- a/src/library/locate/EnvironmentVarData.cpp +++ b/src/library/locate/EnvironmentVarData.cpp @@ -16,7 +16,7 @@ #include "../base/base64.h" #include "../base/EventRegistry.h" -#include "../base/StringUtils.h" +#include "../base/string_utils.h" namespace license { namespace locate { @@ -46,15 +46,13 @@ } const std::string EnvironmentVarData::retrieve_license_content(const std::string &licenseLocation) const { - string tmpVal = getenv(LCC_LICENSE_LOCATION_ENV_VAR); + string env_val = getenv(LCC_LICENSE_LOCATION_ENV_VAR); if (isBase64) { - int flen = 0; - unsigned char *raw = unbase64(tmpVal.c_str(), tmpVal.length(), &flen); - string str = string(reinterpret_cast<char *>(raw)); - free(raw); + vector<uint8_t> data = unbase64(env_val); + string str = string(reinterpret_cast<char *>(data.data())); return str; } - return tmpVal; + return env_val; } } // namespace locate -- Gitblit v1.9.1