[PATCH v2 2/2] erofs-utils: lib: fix memory leak in erofs_gzran_builder_init error path

Ajay Rajera newajay.11r at gmail.com
Sat Mar 21 20:34:46 AEDT 2026


yeah, I just sent patch v3.
Thanks, Ajay.

On Sat, 21 Mar 2026 at 12:51, Gao Xiang <hsiangkao at linux.alibaba.com> wrote:
>
>
>
> 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