Re: [PATCH] builtin/am: fix memory leak in `split_mail_stgit_series`
On Mon, May 12, 2025 at 02:07:27AM +0000, Lidong Yan via GitGitGadget wrote:
Show 7 quoted lines
> From: Lidong Yan <502024330056@smail.nju.edu.cn>
>
> In builtin/am.c:split_mail_stgit_series, if `fopen` failed,
> `series_dir_buf` allocated by `xstrdup` will leak. Add `free` in
> `!fp` if branch will prevent the leak.
>
> Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
This fix looks obviously correct to me. Thanks!
Patrick