Commit 226519ef authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

secur32: Don't try to cleanup uninitialized handles in SECUR32_deinitSchannelSP().

parent 5b479042
...@@ -1415,13 +1415,13 @@ fail: ...@@ -1415,13 +1415,13 @@ fail:
void SECUR32_deinitSchannelSP(void) void SECUR32_deinitSchannelSP(void)
{ {
int i = schan_handle_table_size; SIZE_T i = schan_handle_count;
if (!libgnutls_handle) return; if (!libgnutls_handle) return;
/* deinitialized sessions first because a pointer to the credentials /* deinitialized sessions first because a pointer to the credentials
* are stored for the session by calling gnutls_credentials_set. */ * are stored for the session by calling gnutls_credentials_set. */
while (--i) while (i--)
{ {
if (schan_handle_table[i].type == SCHAN_HANDLE_CTX) if (schan_handle_table[i].type == SCHAN_HANDLE_CTX)
{ {
...@@ -1430,8 +1430,8 @@ void SECUR32_deinitSchannelSP(void) ...@@ -1430,8 +1430,8 @@ void SECUR32_deinitSchannelSP(void)
HeapFree(GetProcessHeap(), 0, ctx); HeapFree(GetProcessHeap(), 0, ctx);
} }
} }
i = schan_handle_table_size; i = schan_handle_count;
while (--i) while (i--)
{ {
if (schan_handle_table[i].type != SCHAN_HANDLE_FREE) if (schan_handle_table[i].type != SCHAN_HANDLE_FREE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment