lib: talloc: Fix bug when calling a destructor.
authorJeremy Allison <jra@samba.org>
Thu, 5 Mar 2015 20:48:47 +0000 (12:48 -0800)
committerStefan Metzmacher <metze@samba.org>
Tue, 10 Mar 2015 09:55:40 +0000 (10:55 +0100)
commit0b702df708b9496ab6408d1bb6a789f44c3bb82b
tree2e042a7e99b2b17a5e468d8fc1ea1a183bc32f3d
parent57fb19ef597cdf6ddce9b3ed8c6e0c13bb6a0b51
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.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
(cherry picked from commit 3289a5d84f73bf044e5767a6c47a3f7bf8357c08)
lib/talloc/talloc.c