mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Avoid a memory leak when allocation of a pCAL buffer fails
Set the PNG_FREE_PCAL flag immediately after the allocation of the first pCAL buffer, so that, if any one of the subsequent allocations fail, all pCAL buffers still get deallocated by png_free_data. Also reorder the initialization of other PNG_FREE_ flags (without altering the semantics) to improve the overall consistency inside the pngset.c module. Co-authored-by: Philippe Antoine <contact@catenacyber.fr> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in: