• Rusty Russell's avatar
    tal: don't defer-after-free if a destructor deletes itself. · c910bdce
    Rusty Russell authored
    ==10868==    at 0x109A96: notify (tal.c:220)
    ==10868==    by 0x109F7E: del_tree (tal.c:397)
    ==10868==    by 0x10A31A: tal_free (tal.c:481)
    ==10868==    by 0x10BE73: main (run-destructor.c:75)
    ==10868==  Address 0x4a60bd8 is 8 bytes inside a block of size 32 free'd
    ==10868==    at 0x483BA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==10868==    by 0x109D4F: del_notifier_property (tal.c:340)
    ==10868==    by 0x10A610: tal_del_notifier_ (tal.c:564)
    ==10868==    by 0x10A687: tal_del_destructor_ (tal.c:576)
    ==10868==    by 0x10B653: remove_own_destructor (run-destructor.c:35)
    ==10868==    by 0x109A67: notify (tal.c:235)
    ==10868==    by 0x109F7E: del_tree (tal.c:397)
    ==10868==    by 0x10A31A: tal_free (tal.c:481)
    ==10868==    by 0x10BE73: main (run-destructor.c:75)
    ==10868==  Block was alloc'd at
    ==10868==    at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==10868==    by 0x109AD5: allocate (tal.c:245)
    ==10868==    by 0x109C3E: add_notifier_property (tal.c:300)
    ==10868==    by 0x10A467: tal_add_destructor_ (tal.c:516)
    ==10868==    by 0x10BDFE: main (run-destructor.c:74)
    Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
    c910bdce
run-destructor.c 1.71 KB