Fancy callstacks cause memory leaks
Can be reproduced by with Valgrind or by compiling XerusTest with address sanitizer and running
$ ASAN_OPTIONS=alloc_dealloc_mismatch=0 ./XerusTest Tensor:triple_indices
###############################################################################
# unit-testing #
###############################################################################
| Tensor:triple_indices starting: ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
| Tensor:triple_indices: passed! (83.552 ms)
|
|
| total summary 1 of 1 passed
-------------------------------------------------------------------------------
|
| Total time elapsed: 83.639 ms
-------------------------------------------------------------------------------
=================================================================
==47735==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 5415540 byte(s) in 31 object(s) allocated from:
#0 0x7ff33cdd193f in __interceptor_malloc (/lib64/libasan.so.6+0xae93f)
#1 0x1088be5 in bfd_malloc /builddir/build/BUILD/binutils-2.35.1/bfd/libbfd.c:275
Direct leak of 526 byte(s) in 9 object(s) allocated from:
#0 0x7ff33cd7c967 in strdup (/lib64/libasan.so.6+0x59967)
#1 0x10d7b6a in scan_unit_for_symbols dwarf2.c:3530
#2 0x10d7b6a in comp_unit_maybe_decode_line_info dwarf2.c:3946
#3 0x10d7b6a in comp_unit_maybe_decode_line_info dwarf2.c:3924
SUMMARY: AddressSanitizer: 5416066 byte(s) leaked in 40 allocation(s).