don't leak the captured file name in NtCreatePagingFile() when probing the other parameters failed

svn path=/trunk/; revision=13582
This commit is contained in:
Thomas Bluemel 2005-02-15 14:37:53 +00:00
parent 4f0495a525
commit a2e0ee8993

View file

@ -775,6 +775,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
}
PreviousMode = ExGetPreviousMode();
Status = RtlCaptureUnicodeString(&CapturedFileName,
PreviousMode,
PagedPool,
@ -805,6 +806,9 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
if (!NT_SUCCESS(Status))
{
RtlReleaseCapturedUnicodeString(&CapturedFileName,
PreviousMode,
FALSE);
return Status;
}
}
@ -834,6 +838,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
CreateFileTypeNone,
NULL,
SL_OPEN_PAGING_FILE | IO_NO_PARAMETER_CHECKING);
RtlReleaseCapturedUnicodeString(&CapturedFileName,
PreviousMode,
FALSE);