[PATCH v2 2/2] erofs-utils: lib: fix memory leak in erofs_gzran_builder_init error path
Gao Xiang
hsiangkao at linux.alibaba.com
Sat Mar 21 18:21:06 AEDT 2026
On 2026/3/21 14:26, Ajay Rajera wrote:
> When inflateInit2() fails, erofs_gzran_builder_init() returns an ERR_PTR(-EFAULT)
> but forgets to free the previously allocated erofs_gzran_builder struct (gb),
> resulting in a memory leak.
>
> Fix by calling free(gb) before returning the error.
>
> Signed-off-by: Ajay Rajera <newajay.11r at gmail.com>
The same issue.
More information about the Linux-erofs
mailing list