mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 09:35:52 +00:00
regedit: Fix memory leak on error path in GetItemPath (scan-build).
This commit is contained in:
parent
7b3690dd73
commit
6c1157435a
|
@ -99,7 +99,10 @@ LPWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey)
|
|||
pathBuffer = malloc(maxLen * sizeof(WCHAR));
|
||||
if (!pathBuffer) return NULL;
|
||||
*pathBuffer = 0;
|
||||
if (!get_item_path(hwndTV, hItem, phRootKey, &pathBuffer, &pathLen, &maxLen)) return NULL;
|
||||
if (!get_item_path(hwndTV, hItem, phRootKey, &pathBuffer, &pathLen, &maxLen)) {
|
||||
free(pathBuffer);
|
||||
return NULL;
|
||||
}
|
||||
return pathBuffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue