NtCreatePagingFile() should release the captured unicode string even if probing the other parameters failed

svn path=/trunk/; revision=13314
This commit is contained in:
Thomas Bluemel 2005-01-26 14:38:27 +00:00
parent a2ea8e6fef
commit 87e84448db

View file

@ -757,15 +757,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
}
PreviousMode = ExGetPreviousMode();
Status = RtlCaptureUnicodeString(&CapturedFileName,
PreviousMode,
PagedPool,
FALSE,
FileName);
if (!NT_SUCCESS(Status))
{
return(Status);
}
if (PreviousMode == UserMode)
{
_SEH_TRY
@ -796,6 +788,16 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
SafeMaximumSize = *MaximumSize;
}
Status = RtlCaptureUnicodeString(&CapturedFileName,
PreviousMode,
PagedPool,
FALSE,
FileName);
if (!NT_SUCCESS(Status))
{
return(Status);
}
InitializeObjectAttributes(&ObjectAttributes,
&CapturedFileName,
0,