can't free non-allocated memory

svn path=/trunk/; revision=11873
This commit is contained in:
Gunnar Dalsnes 2004-11-30 02:28:00 +00:00
parent bcf7f5403f
commit 00641f6f5b

View file

@ -656,7 +656,6 @@ GetCPFileNameFromRegistry(UINT CodePage, LPWSTR FileName, ULONG FileNameSize)
Status = NtOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes);
if (!NT_SUCCESS(Status))
{
RtlFreeUnicodeString(&ValueName);
return FALSE;
}
@ -667,14 +666,13 @@ GetCPFileNameFromRegistry(UINT CodePage, LPWSTR FileName, ULONG FileNameSize)
if (Kvpi == NULL)
{
NtClose(KeyHandle);
RtlFreeUnicodeString(&ValueName);
return FALSE;
}
/* Query the file name for our code page. */
Status = NtQueryValueKey(KeyHandle, &ValueName, KeyValuePartialInformation,
Kvpi, KvpiSize, &KvpiSize);
RtlFreeUnicodeString(&ValueName);
NtClose(KeyHandle);
/* Check if we succeded and the value is non-empty string. */