tal: handle take() pointers more carefully.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 17 Dec 2018 00:16:32 +0000 (10:46 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 17 Dec 2018 00:16:32 +0000 (10:46 +1030)
commit9d2d2c49f053018724bcc6e37029da10b7c3d60d
treeb3262928d83079a8c233be102daf42cef8f8409c
parentd3d2242ba8d975f8d7ddaa0348953dfd6f45ffce
tal: handle take() pointers more carefully.

take() applies to the literal pointer value, so tal_free() means it may
randomly apply to a future allocation.  Similarly, tal_resize() should
preserve it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/tal/tal.c
ccan/tal/tal.h
ccan/tal/test/run-take-free-assert.c [new file with mode: 0644]
ccan/tal/test/run-take.c