Remove incorrect uses of __attribute__((__malloc__)).
commit18a66fbac031c98f9c2077fc88846e4d07849197
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 11 Sep 2023 15:53:31 +0000 (11 18:53 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 22 Sep 2023 17:06:27 +0000 (22 20:06 +0300)
treef348bae228b00567059a3533c38b5d11978fd9d5
parent74b0e900c92d5b222b36f474f1efa431f8e262f7
Remove incorrect uses of __attribute__((__malloc__)).

xrealloc() is obviously incorrect, modern GCC docs even
mention realloc() as an example where this attribute
cannot be used.

liblzma's lzma_alloc() and lzma_alloc_zero() would be
correct uses most of the time but custom allocators
may use a memory pool or otherwise hold the pointer
so aliasing issues could happen in theory.

The xstrdup() case likely was correct but I removed it anyway.
Now there are no __malloc__ attributes left in the code.
The allocations aren't in hot paths so this should make
no practical difference.
src/liblzma/common/common.c
src/liblzma/common/common.h
src/xz/util.h