Free the capture buffer in ObReferenceObjectByName.
Modified: trunk/reactos/ntoskrnl/ob/namespc.c
_____
Modified: trunk/reactos/ntoskrnl/ob/namespc.c
--- trunk/reactos/ntoskrnl/ob/namespc.c 2005-05-21 12:08:46 UTC (rev
15451)
+++ trunk/reactos/ntoskrnl/ob/namespc.c 2005-05-21 12:11:54 UTC (rev
15452)
@@ -76,13 +76,13 @@
NULL,
NULL);
- /* Capture all the info */
- DPRINT("Capturing Create Info\n");
- Status = ObpCaptureObjectAttributes(&ObjectAttributes,
- AccessMode,
- ObjectType,
- &ObjectCreateInfo,
- &ObjectName);
+ /* Capture all the info */
+ DPRINT("Capturing Create Info\n");
+ Status = ObpCaptureObjectAttributes(&ObjectAttributes,
+ AccessMode,
+ ObjectType,
+ &ObjectCreateInfo,
+ &ObjectName);
if (!NT_SUCCESS(Status))
{
DPRINT("ObpCaptureObjectAttributes() failed (Status %lx)\n",
Status);
@@ -90,22 +90,23 @@
}
Status = ObFindObject(&ObjectCreateInfo,
- &ObjectName,
+ &ObjectName,
&Object,
&RemainingPath,
ObjectType);
+ ObpReleaseCapturedAttributes(&ObjectCreateInfo);
+ if (ObjectName.Buffer) ExFreePool(ObjectName.Buffer);
+
if (!NT_SUCCESS(Status))
{
return(Status);
}
-CHECKPOINT;
-DPRINT("RemainingPath.Buffer '%S' Object %p\n", RemainingPath.Buffer,
Object);
+ DPRINT("RemainingPath.Buffer '%S' Object %p\n",
RemainingPath.Buffer, Object);
if (RemainingPath.Buffer != NULL || Object == NULL)
{
-CHECKPOINT;
-DPRINT("Object %p\n", Object);
+ DPRINT("Object %p\n", Object);
*ObjectPtr = NULL;
RtlFreeUnicodeString (&RemainingPath);
return(STATUS_OBJECT_NAME_NOT_FOUND);
@@ -177,22 +178,22 @@
}
Status = ObFindObject(&ObjectCreateInfo,
- &ObjectName,
+ &ObjectName,
&Object,
&RemainingPath,
ObjectType);
+ ObpReleaseCapturedAttributes(&ObjectCreateInfo);
+ if (ObjectName.Buffer) ExFreePool(ObjectName.Buffer);
if (!NT_SUCCESS(Status))
{
DPRINT("ObFindObject() failed (Status %lx)\n", Status);
return Status;
}
- DPRINT("OBject: %x, Remaining Path: %wZ\n", Object,
&RemainingPath);
+ DPRINT("OBject: %x, Remaining Path: %wZ\n", Object, &RemainingPath);
if (Object == NULL)
{
RtlFreeUnicodeString(&RemainingPath);
- ObpReleaseCapturedAttributes(&ObjectCreateInfo);
- if (ObjectName.Buffer) ExFreePool(ObjectName.Buffer);
return STATUS_UNSUCCESSFUL;
}
if (RemainingPath.Buffer != NULL)
@@ -203,8 +204,6 @@
Status =STATUS_OBJECT_PATH_NOT_FOUND;
RtlFreeUnicodeString(&RemainingPath);
ObDereferenceObject(Object);
- ObpReleaseCapturedAttributes(&ObjectCreateInfo);
- if (ObjectName.Buffer) ExFreePool(ObjectName.Buffer);
return Status;
}
@@ -216,8 +215,6 @@
ObDereferenceObject(Object);
RtlFreeUnicodeString(&RemainingPath);
- ObpReleaseCapturedAttributes(&ObjectCreateInfo);
- if (ObjectName.Buffer) ExFreePool(ObjectName.Buffer);
return Status;
}
Show replies by date