From c8f1e9668a97ea7373237969014eb7b910a057a4 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 10 Dec 2009 02:01:59 +0300 Subject: [PATCH] comdlg32/filedlg: Fix a find file handle leak. --- dlls/comdlg32/filedlg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 908201d941f..d8908fec180 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; } }