summaryrefslogtreecommitdiff
path: root/Source/cmDynamicLoader.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-12-05 16:52:55 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2002-12-05 16:52:55 -0500
commita551bfcafc6137e5e592d1af26847625e66c75e8 (patch)
tree22e7f477096b0d62d59490f76b9564927064d1c4 /Source/cmDynamicLoader.cxx
parent11e80e2611e5953cdc40828f20518f1f019cabc4 (diff)
downloadcmake-a551bfcafc6137e5e592d1af26847625e66c75e8.tar.gz
fix free before use
Diffstat (limited to 'Source/cmDynamicLoader.cxx')
-rw-r--r--Source/cmDynamicLoader.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 8c76ad1a0f..a19b6bea72 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;
}