[PATCH v2] wininet: Free security context in failure case.

Daniel Lehman dlehman25 at gmail.com
Thu Nov 29 01:10:17 CST 2018


Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
v2: invalidate handle after free
---
 dlls/wininet/netconnection.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c
index 4ad22177ee..c8bb3973e7 100644
--- a/dlls/wininet/netconnection.c
+++ b/dlls/wininet/netconnection.c
@@ -573,6 +573,10 @@ static DWORD netcon_secure_connect_setup(netconn_t *connection, BOOL compat_mode
         WARN("Failed to establish SSL connection: %08x (%u)\n", status, res);
         heap_free(connection->ssl_buf);
         connection->ssl_buf = NULL;
+        if(SecIsValidHandle(&connection->ssl_ctx)) {
+            DeleteSecurityContext(&connection->ssl_ctx);
+            SecInvalidateHandle(&connection->ssl_ctx);
+        }
         return res ? res : ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
     }
 
-- 
2.17.1




More information about the wine-devel mailing list