summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-12-05 21:52:55 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-12-05 21:52:55 (GMT)
commita551bfcafc6137e5e592d1af26847625e66c75e8 (patch)
tree22e7f477096b0d62d59490f76b9564927064d1c4
parent11e80e2611e5953cdc40828f20518f1f019cabc4 (diff)
downloadCMake-a551bfcafc6137e5e592d1af26847625e66c75e8.zip
CMake-a551bfcafc6137e5e592d1af26847625e66c75e8.tar.gz
CMake-a551bfcafc6137e5e592d1af26847625e66c75e8.tar.bz2
fix free before use
-rw-r--r--Source/cmDynamicLoader.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 8c76ad1..a19b6be 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -294,10 +294,11 @@ const char* cmDynamicLoader::LastError()
);
// Free the buffer.
- LocalFree( lpMsgBuf );
+
static char* str = 0;
delete [] str;
- str = strcpy(new char[strlen((char*)lpMsgBuf)+1], (char*)lpMsgBuf);
+ str = strcpy(new char[strlen((char*)lpMsgBuf)+1], (char*)lpMsgBuf);
+ LocalFree( lpMsgBuf );
return str;
}