From: Patrick Steinhardt Date: Mon, 12 May 2025 08:10:10 GMT Subject: Re: [PATCH] builtin/am: fix memory leak in `split_mail_stgit_series` Message-ID: In-Reply-To: On Mon, May 12, 2025 at 02:07:27AM +0000, Lidong Yan via GitGitGadget wrote: > 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