Nikolay Sivov : comdlg32/filedlg: Fix a find file handle leak.

Alexandre Julliard julliard at winehq.org
Thu Dec 10 10:00:59 CST 2009


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Thu Dec 10 02:01:59 2009 +0300

comdlg32/filedlg: Fix a find file handle leak.

---

 dlls/comdlg32/filedlg.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index 908201d..d8908fe 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -1527,12 +1527,11 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
       if ( win98plus && handledPath == FALSE &&
            fodInfos->filter && *fodInfos->filter) {
 
-         BOOL   searchMore = TRUE;
          LPCWSTR lpstrPos = fodInfos->filter;
          WIN32_FIND_DATAW FindFileData;
          HANDLE hFind;
 
-         while (searchMore)
+         while (1)
          {
            /* filter is a list...  title\0ext\0......\0\0 */
 
@@ -1550,7 +1549,6 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
                lpstrPos += lstrlenW(lpstrPos) + 1;
 
            } else {
-               searchMore = FALSE;
 
                MemFree(fodInfos->initdir);
                fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR));
@@ -1559,6 +1557,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
                handledPath = TRUE;
                TRACE("No initial dir specified, but files of type %s found in current, so using it\n",
                  debugstr_w(lpstrPos));
+               FindClose(hFind);
                break;
            }
          }




More information about the wine-cvs mailing list