From: Lasse Collin Date: Mon, 29 Sep 2025 15:37:19 +0000 (+0300) Subject: liblzma: Document that lzma_allocator.free(opaque, NULL) is possible X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61b114e92f53b7977aad69f8a7130fc25d8a80e5;p=thirdparty%2Fxz.git liblzma: Document that lzma_allocator.free(opaque, NULL) is possible It feels better to fix the docs than change the code because this way newly-written applications will be forced to be compatible with the lzma_allocator behavior of old liblzma versions. It can matter if someone builds the application against an older liblzma version. Fixes: https://github.com/tukaani-project/xz/issues/183 --- diff --git a/src/liblzma/api/lzma/base.h b/src/liblzma/api/lzma/base.h index 0589cde2..00499381 100644 --- a/src/liblzma/api/lzma/base.h +++ b/src/liblzma/api/lzma/base.h @@ -450,7 +450,9 @@ typedef struct { * \param opaque lzma_allocator.opaque (see below) * \param ptr Pointer returned by lzma_allocator.alloc(), * or when it is set to NULL, a pointer returned - * by the standard malloc(). + * by the standard malloc(). In addition, NULL + * is a possible value. The function should do + * nothing when ptr == NULL. */ void (LZMA_API_CALL *free)(void *opaque, void *ptr);