summaryrefslogtreecommitdiffstats
path: root/CommandLineArguments.cxx
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2017-10-10 12:43:01 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-10 12:43:35 (GMT)
commitc551ff588b48cc4c286922779651890da0f3c22c (patch)
treedf0cfeab5a3ba3f8c41ade690b3ba27bb2c22477 /CommandLineArguments.cxx
parent4532b0357261af903f86bc29429ae3c9413b54ab (diff)
downloadCMake-c551ff588b48cc4c286922779651890da0f3c22c.zip
CMake-c551ff588b48cc4c286922779651890da0f3c22c.tar.gz
CMake-c551ff588b48cc4c286922779651890da0f3c22c.tar.bz2
KWSys 2017-10-10 (239bc737)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 239bc737543886a72c5e9e3445d51e17f7e26abe (master). Upstream Shortlog ----------------- Matthias Maennich (5): 6599eda6 testRobustEncoding: restore format flags for std::cout before exiting 862562ce SystemInformation: fix potential off-by-one write 13e02b76 processUNIX: close intermediate file descriptor in error case 73c491e8 processUNIX: fix not null terminated buffer during error reporting ce55a255 testSystemTools: fix some copy'n'paste issues Rolf Eike Beer (5): 6ca15069 SystemTools: make Getcwd() more efficient on Windows 6d7eb3a1 CommandLineArguments: do not check variable before delete[] 3b8fefea remove pointer checks before calling free() cf8beae3 ProcessUNIX: use strdup() instead of open coding it 5d2aff9d ProcessWin32: use strdup() instead of open coding it
Diffstat (limited to 'CommandLineArguments.cxx')
-rw-r--r--CommandLineArguments.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/CommandLineArguments.cxx b/CommandLineArguments.cxx
index 5613bd7..5498377 100644
--- a/CommandLineArguments.cxx
+++ b/CommandLineArguments.cxx
@@ -649,10 +649,7 @@ void CommandLineArguments::PopulateVariable(double* variable,
void CommandLineArguments::PopulateVariable(char** variable,
const std::string& value)
{
- if (*variable) {
- delete[] * variable;
- *variable = 0;
- }
+ delete[] * variable;
*variable = new char[value.size() + 1];
strcpy(*variable, value.c_str());
}