As of C17, realloc with size 0 is marked as an obsolescent feature.
Fix this in backtrace_vector_release by using free instead.
Bootstrapped and reg-tested on x86_64.
2018-11-27 Tom de Vries <tdevries@suse.de>
* alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
instead of realloc.
* Makefile.am (check_PROGRAMS): Add unittest.
* Makefile.in: Regenerate.
* unittest.c: New file.
From-SVN: r266504
PR other/67457
* backtrace.c: #include "internal.h".
(struct backtrace_data): Add can_alloc field.
(unwind): If can_alloc is false, don't try to get file/line
information.
(backtrace_full): Set can_alloc field in bdata.
* alloc.c (backtrace_alloc): Don't call error_callback if it is
NULL.
* mmap.c (backtrace_alloc): Likewise.
* internal.h: Update comments for backtrace_alloc and
backtrace_free.
From-SVN: r227533
* alloc.c (backtrace_vector_finish): Add error_callback and data
parameters. Call backtrace_vector_release. Return address base.
* mmap.c (backtrace_vector_finish): Add error_callback and data
parameters. Return address base.
* dwarf.c (read_function_info): Get new address base from
backtrace_vector_finish.
* internal.h (backtrace_vector_finish): Update declaration.
From-SVN: r205716