From 16c512e7912f1b96087f4ad5bece2b20fe7ca6ea Mon Sep 17 00:00:00 2001 From: malaterre Date: Thu, 11 May 2006 15:23:07 +0000 Subject: [PATCH] BUG: getenv return is not supposed to be freed --- src/gdcmDictSet.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index fe6ec3f1..6011c451 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.cxx,v $ Language: C++ - Date: $Date: 2006/04/14 08:22:13 $ - Version: $Revision: 1.75 $ + Date: $Date: 2006/05/11 15:23:07 $ + Version: $Revision: 1.76 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -128,17 +128,16 @@ Dict *DictSet::GetNextDict() * to "../Dicts/". * @return path to directory containing the dictionaries */ -std::string DictSet::BuildDictPath() +std::string DictSet::BuildDictPath() { std::string resultPath; - /*const*/ char *envPath; - envPath = getenv("GDCM_DICT_PATH"); + const char *envPath = getenv("GDCM_DICT_PATH"); - if (envPath && (strlen(envPath) != 0)) + if (envPath && (strlen(envPath) != 0)) { resultPath = envPath; gdcmStaticWarningMacro( "Dictionary path set from environnement"); - } + } else { resultPath = PUB_DICT_PATH; @@ -147,7 +146,6 @@ std::string DictSet::BuildDictPath() { resultPath += '/'; } - free (envPath); return resultPath; } -- 2.48.1