diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 8240bf01990..df3993d1d4e 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -436,9 +436,9 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, Cleanup: if(pParentProcess != NULL) ObDereferenceObject(pParentProcess); + if(SectionObject != NULL) ObDereferenceObject(SectionObject); if (!ProcessCreated) { - if(SectionObject != NULL) ObDereferenceObject(SectionObject); if(pExceptionPort != NULL) ObDereferenceObject(pExceptionPort); if(pDebugPort != NULL) ObDereferenceObject(pDebugPort); if(Process != NULL) ObDereferenceObject(Process);