Thread (1 message) 1 message, 1 author, 2023-02-02

Re: [PATCH v6 17/19] receive-pack: free() the "ref_name" in "struct command"

From: Junio C Hamano <hidden>
Date: 2023-02-02 21:55:36

Ævar Arnfjörð Bjarmason  [off-list ref] writes:
Fix a memory leak that's been with us since this code was introduced
in 575f497456e (Add first cut at "git-receive-pack", 2005-06-29). See
eb1af2df0b1 (git-receive-pack: start parsing ref update commands,
2005-06-29) for the later change that refactored the code to add the
"ref_name" member.
The above description does not really match what the patch does,
though.  Yes, command.ref_name[] member held varying number of bytes
in it, but the code was leaking a singly linked list of the entire
command structure, not just ref_name[] member.  And the patch makes
sure we will release the resource held by the entire chain, not just
the ref_name flex-array member.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help