From 348c8da73d2a3505a9cb3e32b3ae0e4b86f0f361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 4 Jul 2016 22:23:07 +0000 Subject: [PATCH] [NTOS]: Exit gently in MmCreateTeb if the call to MiCreatePebOrTeb failed. This is OK since the callers of MmCreateTeb check for its failure, and also perform cleanup & exit in accordance. svn path=/trunk/; revision=71815 --- reactos/ntoskrnl/mm/ARM3/procsup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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