[SHELL32] Fix BrowseForFolder expanding a folder containing a zip (#7585)

Commit 325d74c30f (PR #7437) introduced a side effect that made impossible
to expand a folder when it contained both a ZIP file and subfolders.

Fix this by ignoring the return value of BrFolder_InsertItem and free the
pidlTemp pointer explicitly in all cases.

CORE-19955 CORE-19751
This commit is contained in:
Denis Robert
2024-12-30 14:14:44 +01:00
committed by GitHub
parent 26f8fa7ade
commit 894e5cddd6

View File

@@ -408,8 +408,8 @@ BrFolder_Expand(
ULONG ulFetched;
while (S_OK == pEnum->Next(1, &pidlTemp, &ulFetched))
{
if (!BrFolder_InsertItem(info, lpsf, pidlTemp, pidlFull, hParent))
break;
/* Ignore return value of BrFolder_InsertItem to avoid incomplete folder listing */
BrFolder_InsertItem(info, lpsf, pidlTemp, pidlFull, hParent);
pidlTemp.Free(); // Finally, free the pidl that the shell gave us...
}