]> git.ipfire.org Git - thirdparty/xz.git/commit
Remove incorrect uses of __attribute__((__malloc__)).
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 11 Sep 2023 15:53:31 +0000 (18:53 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 7 May 2024 12:44:54 +0000 (15:44 +0300)
commit015e62b18d38cd3a67fea631375ebbab610274fe
treee332ed7204f2eb44c930b9cb85571345c3cf76db
parentba791978d5f3d86d22b8f75c9e047fbd5794ed08
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.

(cherry picked from commit 359e5c6cb128dab64ea6070d21d1c240f96cea6b)
src/liblzma/common/common.c
src/liblzma/common/common.h
src/xz/util.h