diff --git a/expat/fuzz/xml_lpm_fuzzer.cpp b/expat/fuzz/xml_lpm_fuzzer.cpp index a2982fc2..87c99be1 100644 --- a/expat/fuzz/xml_lpm_fuzzer.cpp +++ b/expat/fuzz/xml_lpm_fuzzer.cpp @@ -79,23 +79,23 @@ static std::vector g_fail_allocations = {}; void * MallocHook(size_t size) { + g_allocation_count += 1; for (auto index : g_fail_allocations) { if (index == g_allocation_count) { return NULL; } } - g_allocation_count += 1; return malloc(size); } void * ReallocHook(void *ptr, size_t size) { + g_allocation_count += 1; for (auto index : g_fail_allocations) { if (index == g_allocation_count) { return NULL; } } - g_allocation_count += 1; return realloc(ptr, size); }