Re: [PATCH] Allocate msg only after fatal checks to avoid leaks
- From
lidongyan <502024330056@smail.nju.edu.cn>
- Date
- Jun 14, 2025, 08:26 UTC
- Message-ID
- <3993AF96-E03D-46AB-B18E-8E6C1108EC45@smail.nju.edu.cn>
- In-Reply-To
- <pull.1998.git.git.1749843142000.gitgitgadget@gmail.com>
Alex via GitGitGadget <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> > From: jinyaoguo <guo846@purdue.edu> > > In parse_reuse_arg, we previously called xmalloc and strbuf_init > before resolving the ref and reading the object, leading to a > leaked msg on die() paths. This change moves the allocation of
A memory leak on the die() path shouldn't be considered a real leak, right? Since the OS will clean up all memory once the process terminates, explicitly freeing msg isn't necessary in this case.
Lidong