Commit 6c115743 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

regedit: Fix memory leak on error path in GetItemPath (scan-build).

parent 7b3690dd
...@@ -99,7 +99,10 @@ LPWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey) ...@@ -99,7 +99,10 @@ LPWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey)
pathBuffer = malloc(maxLen * sizeof(WCHAR)); pathBuffer = malloc(maxLen * sizeof(WCHAR));
if (!pathBuffer) return NULL; if (!pathBuffer) return NULL;
*pathBuffer = 0; *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; return pathBuffer;
} }
......
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