diff options
| author | Linus Arver <linusa@google.com> | 2024-03-01 00:14:38 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-01 10:35:42 -0800 |
| commit | 0f3a461d4e0f8854181054d86681c0664ae8c0cc (patch) | |
| tree | d3771e50355bed29a36104399357ce6b58e4955c /commit.c | |
| parent | The sixth batch (diff) | |
| download | git-0f3a461d4e0f8854181054d86681c0664ae8c0cc.tar.gz git-0f3a461d4e0f8854181054d86681c0664ae8c0cc.zip | |
trailer: free trailer_info _after_ all related usage
In de7c27a186 (trailer: use offsets for trailer_start/trailer_end,
2023-10-20), we started using trailer block offsets in trailer_info. In
particular, we dropped the use of a separate stack variable "size_t
trailer_end", in favor of accessing the new "trailer_block_end" member
of trailer_info (as "info.trailer_block_end").
At that time, we forgot to also move the
trailer_info_release(&info);
line to be _after_ this new use of the trailer_info struct. Move it now.
Note that even without this patch, we didn't have leaks or any other
problems because trailer_info_release() only frees memory allocated on
the heap. The "trailer_block_end" member was allocated on the stack back
then (as it is now) so it was still safe to use for all this time.
Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Linus Arver <linusa@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions
