krb5 commit: Add leak tracking support to Leash

Benjamin Kaduk kaduk at MIT.EDU
Fri Aug 24 15:55:22 EDT 2012


https://github.com/krb5/krb5/commit/9d7ce5070d6d5f8390b941cdb617c670f1bf0989
commit 9d7ce5070d6d5f8390b941cdb617c670f1bf0989
Author: Kevin Wasserman <kevin.wasserman at painless-security.com>
Date:   Mon May 21 08:12:43 2012 -0400

    Add leak tracking support to Leash
    
    Signed-off-by: Kevin Wasserman <kevin.wasserman at painless-security.com>
    
    ticket: 7260 (new)
    queue: kfw
    target_version: 1.10.4
    tags: pullup

 src/windows/leash/Leash.cpp |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/windows/leash/Leash.cpp b/src/windows/leash/Leash.cpp
index 44e687b..27d1db1 100644
--- a/src/windows/leash/Leash.cpp
+++ b/src/windows/leash/Leash.cpp
@@ -127,6 +127,9 @@ CLeashApp::~CLeashApp()
 	AfxFreeLibrary(m_hPsapi);
     AfxFreeLibrary(m_hToolHelp32);
     AfxFreeLibrary(m_hKrbLSA);
+#ifdef DEBUG
+    _CrtDumpMemoryLeaks();
+#endif
 }
 
 /////////////////////////////////////////////////////////////////////////////
@@ -158,6 +161,15 @@ extern "C" {
 
 BOOL CLeashApp::InitInstance()
 {
+#ifdef DEBUG
+    _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
+    _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );
+    _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
+    _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT );
+
+    int tmp = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG);
+    _CrtSetDbgFlag( tmp | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+#endif
     AfxOleInit();
     // NOTE: Not used at this time
     /// Set LEASH_DLL to the path where the Leash.exe is


More information about the cvs-krb5 mailing list