Ensure memory is freed when zrealloc is called with size 0
authorJonathan Dieter <jdieter@gmail.com>
Tue, 4 Apr 2023 20:14:49 +0000 (21:14 +0100)
committerJonathan Dieter <jdieter@gmail.com>
Tue, 4 Apr 2023 20:14:49 +0000 (21:14 +0100)
commit38ef83d846c25a24fe01655b1f2b5ca91c94f997
tree9a731ce7e5ab6efd9c7acc1609893c119e4c1acf
parente9e393ae40d016541d28ba7059d33a4fffb2e6ed
Ensure memory is freed when zrealloc is called with size 0

zrealloc is supposed to handle freeing the old pointer when called, but
when called with size 0, it was not always working as expected.  This
commit fixes the bug.  Thanks to Agostino Sarubbo of Gentoo for providing
a bug report with a reproducible test case.

Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/zck.c