Francois Gouget : wininet: Fix a couple of reversed checks that could result in leaked socket handles .

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 8 15:35:53 CST 2007


Module: wine
Branch: master
Commit: fa41be3fdb2c9b524a3bf10970dd586d3e2049b6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fa41be3fdb2c9b524a3bf10970dd586d3e2049b6

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Mar  8 15:30:41 2007 +0100

wininet: Fix a couple of reversed checks that could result in leaked socket handles.

---

 dlls/wininet/ftp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 4373c3c..7cb49e1 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -2007,7 +2007,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
     }
 
 lerror:
-    if (!bSuccess && nsocket == -1)
+    if (!bSuccess && nsocket != -1)
         closesocket(nsocket);
 
     if (!bSuccess && lpwfs)
@@ -2378,7 +2378,7 @@ static BOOL FTP_InitListenSocket(LPWININETFTPSESSIONW lpwfs)
         bSuccess = TRUE;
 
 lend:
-    if (!bSuccess && lpwfs->lstnSocket == -1)
+    if (!bSuccess && lpwfs->lstnSocket != -1)
     {
         closesocket(lpwfs->lstnSocket);
         lpwfs->lstnSocket = -1;




More information about the wine-cvs mailing list