git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin/am: fix memory leak in `split_mail_stgit_series`

From
Patrick Steinhardt <ps@pks.im>
Date
May 12, 2025, 08:10 UTC
Message-ID
<aCGs4nRjjHAs6aYu@pks.im>
In-Reply-To
<pull.1961.git.git.1747015647505.gitgitgadget@gmail.com>
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
Previous: Lidong Yan via GitGitGadgetNext: Junio C Hamano
Message 2 of 3 in “builtin/am: fix memory leak in `split_mail_stgit_series`”
  1. builtin/am: fix memory leak in `split_mail_stgit_series`Lidong Yan via GitGitGadget, May 12, 2025
  2. Patrick SteinhardtMay 12, 2025
  3. Junio C HamanoMay 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.