Alex Henrie (@alexhenrie) commented about dlls/ntdll/tests/virtual.c:
NtClose( file );
}
+static void test_massive_memory_reservation(void) +{
- /* No ok() usage here, failing the test == getting killed by the OOM killer */
- SIZE_T i;
- for (i = page_size; i; i <<= 1)
- {
void* ptr;
ptr = VirtualAlloc(NULL, i, MEM_RESERVE, PAGE_NOACCESS);
if (ptr)
VirtualFree(ptr, i, MEM_RELEASE);
ptr = malloc(i);
if (ptr)
It's unnecessary to check for null before calling `free` because `free(NULL)` is guaranteed to do nothing.