mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:41:12 +00:00
regedit: Fix possible memory leaks.
This commit is contained in:
parent
223c24bdbf
commit
039df36b16
1 changed files with 3 additions and 0 deletions
|
@ -434,6 +434,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
|
|||
}
|
||||
tvItem.cchTextMax = dwMaxSubKeyLen;
|
||||
if (!(tvItem.pszText = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(WCHAR)))) {
|
||||
HeapFree(GetProcessHeap(), 0, Name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -462,6 +463,8 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
|
|||
tvItem.mask = TVIF_TEXT;
|
||||
tvItem.hItem = childItem;
|
||||
if (!TreeView_GetItemW(hwndTV, &tvItem)) {
|
||||
HeapFree(GetProcessHeap(), 0, Name);
|
||||
HeapFree(GetProcessHeap(), 0, tvItem.pszText);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue