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