summaryrefslogtreecommitdiffstats
path: root/Source/cmDynamicLoader.cxx
diff options
context:
space:
mode:
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 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;
}