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

parentPath is allocated before parentKey.
This commit is contained in:
Alex Henrie 2023-06-18 22:32:00 -06:00 committed by Alexandre Julliard
parent 267ee07ded
commit 3d383c468b

View file

@ -680,9 +680,7 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName)
done: done:
RegCloseKey(destKey); RegCloseKey(destKey);
if (parentKey) {
RegCloseKey(parentKey); RegCloseKey(parentKey);
free(parentPath); free(parentPath);
}
return result; return result;
} }