Commit a18bc73f authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

shell32: Fix a memory leak in SHFileOperationW.

parent 4f0dfb51
......@@ -1192,6 +1192,14 @@ static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST
if (flFrom->dwNumFiles != 1 && !IsAttribDir(fileDest->attributes))
return ERROR_CANCELLED;
/* Free all but the first entry. */
for (i = 1; i < flTo->dwNumFiles; i++)
{
HeapFree(GetProcessHeap(), 0, flTo->feFiles[i].szDirectory);
HeapFree(GetProcessHeap(), 0, flTo->feFiles[i].szFilename);
HeapFree(GetProcessHeap(), 0, flTo->feFiles[i].szFullPath);
}
flTo->dwNumFiles = 1;
}
else if (IsAttribDir(fileDest->attributes))
......
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