summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-03-07 21:35:58 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-07 13:59:19 -0800
commit1a0359181263029468736aba04565af308be89d0 (patch)
treeced38c3b52d618cd0f6762333fd42279dfd5c7db /commit.c
parent43072b4ca132437f21975ac6acc6b72dc22fd398 (diff)
reftable/record: fix memory leak when decoding object records
When decoding records it is customary to reuse a `struct reftable_ref_record` across calls. Thus, it may happen that the record already holds some allocated memory. When decoding ref and log records we handle this by releasing or reallocating held memory. But we fail to do this for object records, which causes us to leak memory. Fix this memory leak by releasing object records before we decode into them. We may eventually want to reuse memory instead to avoid needless reallocations. But for now, let's just plug the leak and be done. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions