Commit ded5b05e authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

regedit: Fix memory leaks in favourites handling.

parent 455ce06d
......@@ -531,6 +531,7 @@ static INT_PTR CALLBACK addtofavorites_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM w
EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
SetWindowTextW(hwndValue, ItemPath);
SendMessageW(hwndValue, EM_SETLIMITTEXT, 127, 0);
HeapFree(GetProcessHeap(), 0, ItemPath);
return TRUE;
}
case WM_COMMAND:
......
......@@ -208,7 +208,10 @@ HTREEITEM FindPathInTree(HWND hwndTV, LPCWSTR lpKeyName) {
if (!lstrcmpiW(tvi.pszText, lpItemName)) {
SendMessageW(hwndTV, TVM_EXPAND, TVE_EXPAND, (LPARAM)hItem );
if (!lpKeyName)
{
HeapFree(GetProcessHeap(), 0, lpItemName);
return hItem;
}
hOldItem = hItem;
hItem = TreeView_GetChild(hwndTV, hItem);
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