]> git.ipfire.org Git - thirdparty/git.git/commit
notes: fix memory leak when pruning notes
authorPatrick Steinhardt <ps@pks.im>
Tue, 11 Jun 2024 09:19:50 +0000 (11:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2024 20:15:05 +0000 (13:15 -0700)
commitf644dc84949bcc6d6d06274a30feb4b366ae68de
tree575d800735a9687ed89c1e0f7c4c33a91382c0ce
parent97485374377fa62fdd36f4b707e2fcd8f1a7c6c3
notes: fix memory leak when pruning notes

In `prune_notes()` we first store the notes that are to be deleted in a
local list, and then iterate through that list to delete those notes one
by one. We never free the list though and thus leak its memory. Fix
this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes.c
t/t3306-notes-prune.sh