ff88fb0d3a
When using a FILE object for some malloc debug functions, calling fprintf will trigger an allocation to be put in the object. The problem is that these allocations were not allocated by the malloc debug wrapper and they get freed during the fclose as if they are malloc debug allocation. In most cases, the code will detect the bad pointer and leak the memory, but it might also cause a crash. The fix is to avoid using fprintf so that no allocations are made in the object that survive and need to be freed in the fclose call. Change the MallocXmlElem.h to use a file decsriptor not a FILE object. Add new unit and system tests to detect this case. Bug: 143742907 Test: Ran unit and system tests. Test: Ran bionic unit tests. Change-Id: I524392de822a29483aa5be8f14c680e70033eba2 |
||
---|---|---|
.. | ||
backtrace_fake.cpp | ||
backtrace_fake.h | ||
libc_fake.cpp | ||
log_fake.cpp | ||
log_fake.h | ||
malloc_debug_config_tests.cpp | ||
malloc_debug_system_tests.cpp | ||
malloc_debug_unit_tests.cpp |