Only clear 0xdeadbeef if there is 0xdeadbeef present. The size field of the
heap leak check info would otherwise be overwritten for allocations that still fit the 16 byte bin (i.e. allocations of 0-4 bytes). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23956 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e6b529a362
commit
cf2687e48f
|
@ -721,7 +721,8 @@ heap_memalign(heap_allocator *heap, size_t alignment, size_t size,
|
|||
#if PARANOID_KFREE
|
||||
// make sure 0xdeadbeef is cleared if we do not overwrite the memory
|
||||
// and the user does not clear it
|
||||
((uint32 *)address)[1] = 0xcccccccc;
|
||||
if (((uint32 *)address)[1] == 0xdeadbeef)
|
||||
((uint32 *)address)[1] = 0xcccccccc;
|
||||
#endif
|
||||
|
||||
#if PARANOID_KMALLOC
|
||||
|
|
Loading…
Reference in New Issue