diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-07-01 12:42:54 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-07-01 11:43:43 -0700 |
| commit | d90dafbe3180aa0ad095a5f2fa9c83bfa3d3767d (patch) | |
| tree | 0c0be25af1ce54c981a022761185f263b2ee678b /builtin/merge-file.c | |
| parent | revert: free "struct replay_opts" members (diff) | |
| download | git-d90dafbe3180aa0ad095a5f2fa9c83bfa3d3767d.tar.gz git-d90dafbe3180aa0ad095a5f2fa9c83bfa3d3767d.zip | |
cat-file: fix a memory leak in --batch-command mode
Fix a memory leak introduced in 440c705ea63 (cat-file: add
--batch-command mode, 2022-02-18). The free_cmds() function was only
called on "queued_nr" if we had a "flush" command. As the "without
flush for blob info" test added in the same commit shows we can't rely
on that, so let's call free_cmds() again at the end.
Since "nr" follows the usual pattern of being set to 0 if we've
free()'d the memory already it's OK to call it twice, even in cases
where we are doing a "flush".
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-file.c')
0 files changed, 0 insertions, 0 deletions
