if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
+ RtlFreeUnicodeString(&NamedPipeName);
return FALSE;
}
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
+ RtlFreeUnicodeString(&NamedPipeName);
return FALSE;
}
+ RtlFreeUnicodeString(&NamedPipeName);
return TRUE;
}
#endif
NTSTATUS Status;
/* Calculate the buffer space that we'll need and allocate it */
- BufferSize = nBufferSize + FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[0]);
+ BufferSize = nBufferSize + sizeof(FILE_PIPE_PEEK_BUFFER);
Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferSize);
if (Buffer == NULL)
{