From 8cea9fc75a753f878423ab903a0d036830b7576a Mon Sep 17 00:00:00 2001 From: 3fault Date: Thu, 17 Jul 2025 10:55:45 -0400 Subject: [PATCH] Ensure memory is freed after guard page test --- src/samples/test-sample/test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/samples/test-sample/test.cpp b/src/samples/test-sample/test.cpp index feece83f..fa2d844a 100644 --- a/src/samples/test-sample/test.cpp +++ b/src/samples/test-sample/test.cpp @@ -734,6 +734,13 @@ namespace success = false; } + // Free the allocated memory + if (!VirtualFree(addr, 0, MEM_RELEASE)) + { + puts("Failed to free allocated region"); + success = false; + } + return success; }