mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
[NTOS:WMI] Be consistent about potential NULL pointer use
This commit is contained in:
parent
17a9041da1
commit
d18634c026
1 changed files with 13 additions and 8 deletions
|
@ -108,20 +108,25 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
IoWMIWriteEvent(_Inout_ PVOID WnodeEventItem)
|
IoWMIWriteEvent(_Inout_ PVOID WnodeEventItem)
|
||||||
{
|
{
|
||||||
DPRINT1("IoWMIWriteEvent() called for WnodeEventItem %p (Flags = 0x%08lx), returning success\n",
|
PWNODE_HEADER Header = WnodeEventItem;
|
||||||
WnodeEventItem, ((PWNODE_HEADER)WnodeEventItem)->Flags);
|
|
||||||
|
|
||||||
if (((PWNODE_HEADER)WnodeEventItem)->Flags & WNODE_FLAG_TRACED_GUID)
|
if(!Header)
|
||||||
{
|
{
|
||||||
DPRINT("IoWMIWriteEvent(): Flags has WNODE_FLAG_TRACED_GUID\n");
|
DPRINT1("Got NULL Item!\n");
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT1("IoWMIWriteEvent() called for WnodeEventItem %p (Flags = 0x%08lx), returning success\n",
|
||||||
|
WnodeEventItem, Header->Flags);
|
||||||
|
|
||||||
|
if (Header->Flags & WNODE_FLAG_TRACED_GUID)
|
||||||
|
{
|
||||||
// Never free WnodeEventItem in this case.
|
// Never free WnodeEventItem in this case.
|
||||||
|
DPRINT("IoWMIWriteEvent(): Flags has WNODE_FLAG_TRACED_GUID\n");
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the buffer if we are returning success */
|
/* Free the buffer if we are returning success */
|
||||||
if (WnodeEventItem != NULL)
|
|
||||||
ExFreePool(WnodeEventItem);
|
ExFreePool(WnodeEventItem);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in a new issue