diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c index bb8cf6f2461..9e6e9e0bd73 100644 --- a/programs/regedit/childwnd.c +++ b/programs/regedit/childwnd.c @@ -138,7 +138,7 @@ static LPWSTR GetPathRoot(HWND hwndTV, HTREEITEM hItem, BOOL bFull) { HKEY hRootKey = NULL; if (!hItem) hItem = TreeView_GetSelection(hwndTV); - GetItemPath(hwndTV, hItem, &hRootKey); + HeapFree(GetProcessHeap(), 0, GetItemPath(hwndTV, hItem, &hRootKey)); if (!bFull && !hRootKey) return NULL; if (hRootKey)