瀏覽代碼

Memory leak from PuTTY 0.76 (2514e9cd, on master branch c3783817)

(cherry picked from commit efe319a03fd1d2b0f2d1e80e0ea0e0a6177f3bb3)

Source commit: 16ed4c873f53af2a63f50ae0433cdecf9494d6e6
Martin Prikryl 4 年之前
父節點
當前提交
a13b8f9ac3
共有 3 個文件被更改,包括 16 次插入0 次删除
  1. 1 0
      source/core/PuttyIntf.cpp
  2. 2 0
      source/putty/puttyexp.h
  3. 13 0
      source/putty/windows/wingss.c

+ 1 - 0
source/core/PuttyIntf.cpp

@@ -79,6 +79,7 @@ void __fastcall PuttyFinalize()
   win_misc_cleanup();
   win_secur_cleanup();
   ec_cleanup();
+  wingss_cleanup();
   DeleteCriticalSection(&putty_section);
 }
 //---------------------------------------------------------------------------

+ 2 - 0
source/putty/puttyexp.h

@@ -31,6 +31,8 @@ int have_any_ssh2_hostkey(Seat * seat, const char * host, int port);
 #include "sshgss.h"
 #endif
 
+void wingss_cleanup(void);
+
 // from portfwd.c
 
 int is_pfwd(Plug * plug);

+ 13 - 0
source/putty/windows/wingss.c

@@ -748,3 +748,16 @@ void ssh_gss_init(void)
 }
 
 #endif
+
+#ifdef WINSCP
+
+void wingss_cleanup(void)
+{
+    if (libraries_to_never_unload != NULL)
+    {
+        freetree234(libraries_to_never_unload);
+        libraries_to_never_unload = NULL;
+    }
+}
+
+#endif