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)
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;
}
}
......
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