https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e7bbbf049e3c53f7477fb…
commit e7bbbf049e3c53f7477fb3c53e1910ac417066b5
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Wed Aug 31 15:08:41 2022 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Dec 1 20:17:40 2022 +0200
[NTOS] Fix double free on allocation failure in ObCreateObject
---
ntoskrnl/ob/oblife.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ntoskrnl/ob/oblife.c b/ntoskrnl/ob/oblife.c
index f46cb4098b3..9704ad8b355 100644
--- a/ntoskrnl/ob/oblife.c
+++ b/ntoskrnl/ob/oblife.c
@@ -1035,6 +1035,7 @@ ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL,
/* Release the Capture Info, we don't need it */
ObpFreeObjectCreateInformation(ObjectCreateInfo);
if (ObjectName.Buffer) ObpFreeObjectNameBuffer(&ObjectName);
+ return Status;
}
/* We failed, so release the Buffer */