[FLTMGR] CreateClientPort(): Fix ObInsertObject() error handling

Avoid extra ObDereferenceObject().

CORE-17904
This commit is contained in:
Serge Gautherie 2021-05-24 08:56:17 +02:00 committed by Victor Perevertkin
parent a23249e137
commit 5ba5051f79

View file

@ -699,10 +699,12 @@ CreateClientPort(_In_ PFILE_OBJECT FileObject,
goto Quit;
}
/* Now insert the new client port into the object manager*/
Status = ObInsertObject(ClientPortObject, 0, FLT_PORT_ALL_ACCESS, 1, 0, (PHANDLE)&PortHandle);
/* Now insert the new client port into the object manager */
Status = ObInsertObject(ClientPortObject, NULL, FLT_PORT_ALL_ACCESS, 1, NULL, (PHANDLE)&PortHandle);
if (!NT_SUCCESS(Status))
{
/* ObInsertObject() failed and already dereferenced ClientPortObject */
ClientPortObject = NULL;
goto Quit;
}