reworked talloc() to in order to help track down invalid
authorGerald Carter <jerry@samba.org>
Sat, 12 Aug 2000 14:14:40 +0000 (14:14 +0000)
committerGerald Carter <jerry@samba.org>
Sat, 12 Aug 2000 14:14:40 +0000 (14:14 +0000)
commit233b9cffa2350552d9f775f791d5d5e0464a1ed4
treed8e72d442946c6377ae9c4132de099ef4693cb99
parentf806881e6c2c94c03fb7e70d92cd0a5a3fc30fbd
reworked talloc() to in order to help track down invalid
memory access.

Tridge, I don't think using 0xdeadbeef for size allocations
of 0 is going to work.  I ended up having to use NULL
as much code that works on UNISTR checks to see if the buffer ptr
is NULL.  So valid code ends up with a seg fault.

Rather than rewriting it all, I added a DEBUG_TALLOC
#ifdef in talloc.h that sets a macro BAD_PTR.
This is the value assigned to ptr for an allocation of 0 bytes.

jerry
source/include/talloc.h
source/lib/talloc.c