Commit c8f1e966 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comdlg32/filedlg: Fix a find file handle leak.

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