lib: talloc: Fix bug when calling a destructor.
commit599ca101656d1111ff7aec32d1a813ef434d9977
authorJeremy Allison <jra@samba.org>
Thu, 5 Mar 2015 20:48:47 +0000 (5 12:48 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 24 Mar 2015 03:51:14 +0000 (24 04:51 +0100)
tree356665516f4126b0ce3897b30e1b28c73f4309cc
parentbb97c5e20c7ad3c6ec6e6b46f73ceb5636bc478d
lib: talloc: Fix bug when calling a destructor.

If the destructor itself calls talloc_set_destructor()
and returns -1, the new destructor set is overwritten
by talloc.

Dectect that and leave the new destructor in place.

Needed for bug:

https://bugzilla.samba.org/show_bug.cgi?id=11144

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
lib/talloc/talloc.c