[PATCH 2/2] erofs-utils: lib: add guard clause for z_erofs_compress_init

Gao Xiang hsiangkao at linux.alibaba.com
Sat Jul 12 02:39:33 AEST 2025


Hi Yifan,

On 2025/7/12 00:16, Yifan Zhao wrote:
> Currently, `z_erofs_compress_init` allocates heap memory for `zmgr` even
> when compression is disabled, causing a memory leak. Let's add a guard
> clause to skip this allocation.

I think we should free(zmgr) in z_erofs_compress_exit() instead.

allocates zmgr is not a major issue, but I tend to cleanup
`cfg.c_compr_opts` and even `cfg` soon.

Thanks,
Gao Xiang


More information about the Linux-erofs mailing list