On 11/23/18 1:51 PM, Tom de Vries wrote: > [ was: Re: [PATCH 1/2][libbacktrace] Handle realloc returning NULL if size == > 0 ] > > On Thu, Nov 22, 2018 at 06:16:20PM +0000, Joseph Myers wrote: >> On Thu, 22 Nov 2018, Tom de Vries wrote: >> >>> Hi, >>> >>> If realloc is called with size 0, realloc can return NULL. >> >> Note that, as of C17, realloc with size 0 is marked as an obsolescent >> feature (because of inconsistencies between implementations regarding >> whether the old object is deallocated). So it would be advisable for code >> intended to be portable to avoid calling realloc with size 0 at all. >> > > Updated patch to avoid realloc with size 0. > > OK for trunk? > > Thanks, > - Tom > > [libbacktrace] Avoid realloc with size == 0 in backtrace_vector_release > > 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-22 Tom de Vries <tdevr...@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. OK.
Are any of the subsequent patches in this series still relevant? jeff