Dylan Smith : secur32: Free schannel handle table.
Alexandre Julliard
julliard at winehq.org
Mon Sep 28 11:54:39 CDT 2009
Module: wine
Branch: master
Commit: fd3c8335fd91e9a1952eabf4abd1cf8b5631dfd5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fd3c8335fd91e9a1952eabf4abd1cf8b5631dfd5
Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date: Mon Sep 28 03:48:38 2009 -0400
secur32: Free schannel handle table.
The table is initialized on process attach, and should be freed on process
detach (which is where SECUR32_deinitSchannelSP gets called).
---
dlls/secur32/schannel.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
index 3912fbd..f776206 100644
--- a/dlls/secur32/schannel.c
+++ b/dlls/secur32/schannel.c
@@ -1413,8 +1413,33 @@ fail:
void SECUR32_deinitSchannelSP(void)
{
+ int i = schan_handle_table_size;
+
if (!libgnutls_handle) return;
+ /* deinitialized sessions first because a pointer to the credentials
+ * are stored for the session by calling gnutls_credentials_set. */
+ while (--i)
+ {
+ if (schan_handle_table[i].type == SCHAN_HANDLE_CTX)
+ {
+ struct schan_context *ctx = schan_free_handle(i, SCHAN_HANDLE_CTX);
+ pgnutls_deinit(ctx->session);
+ HeapFree(GetProcessHeap(), 0, ctx);
+ }
+ }
+ i = schan_handle_table_size;
+ while (--i)
+ {
+ if (schan_handle_table[i].type != SCHAN_HANDLE_FREE)
+ {
+ struct schan_credentials *cred;
+ cred = schan_free_handle(i, SCHAN_HANDLE_CRED);
+ pgnutls_certificate_free_credentials(cred->credentials);
+ HeapFree(GetProcessHeap(), 0, cred);
+ }
+ }
+ HeapFree(GetProcessHeap(), 0, schan_handle_table);
pgnutls_global_deinit();
wine_dlclose(libgnutls_handle, NULL, 0);
}
More information about the wine-cvs
mailing list