diff --git a/reactos/ntoskrnl/mm/ARM3/procsup.c b/reactos/ntoskrnl/mm/ARM3/procsup.c index 43853c44a92..e415a6e27b6 100644 --- a/reactos/ntoskrnl/mm/ARM3/procsup.c +++ b/reactos/ntoskrnl/mm/ARM3/procsup.c @@ -757,7 +757,12 @@ MmCreateTeb(IN PEPROCESS Process, // Allocate the TEB // Status = MiCreatePebOrTeb(Process, sizeof(TEB), (PULONG_PTR)&Teb); - ASSERT(NT_SUCCESS(Status)); + if (!NT_SUCCESS(Status)) + { + /* Cleanup and exit */ + KeDetachProcess(); + return Status; + } // // Use SEH in case we can't load the TEB