regedit: Fix memory leaks in favourites handling.

This commit is contained in:
Alexander Nicolaysen Sørnes 2008-08-24 22:10:08 +02:00 committed by Alexandre Julliard
parent 455ce06d4f
commit ded5b05e4a
2 changed files with 4 additions and 0 deletions

View File

@ -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:

View File

@ -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;