Re: [PATCH v2] repo_logmsg_reencode: fix memory leak when use repo_logmsg_reencode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 05, 2025 at 06:27:26AM +0000, Lidong Yan via GitGitGadget wrote:

> From: Lidong Yan <502024330056@xxxxxxxxxxxxxxxx>
> 
> pretty.c:repo_logmsg_reencode() allocated memory should be freed with
> repo_unuse_commit_buffer(). Callers sometimes forgot free it at exit
> point. Add `repo_unuse_commit_buffer()` in insert_records_from_trailers
> at builtin/shortlog.c and create_commit at builtin/replay.c

The patch here looks fine, and I can confirm with the hacky test-patch
I showed elsewhere in the thread that the case in replay.c is fixed.

I don't think the shortlog one is triggered by the test suite, and it's
probably not worth adding a specific test for a commit with no header
separator.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux