summaryrefslogtreecommitdiff
path: root/t/t6034-merge-rename-nocruft.sh
diff options
context:
space:
mode:
authorMartin Ågren <martin.agren@gmail.com>2019-07-10 18:36:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-10 20:27:13 (GMT)
commit14d30cdfc047fdff33c359f17cbb070f2faed009 (patch)
tree45748fe10fb6e9e9cfbeb1854e0e9b8a12949c08 /t/t6034-merge-rename-nocruft.sh
parent6d5b26420848ec3bc7eae46a7ffa54f20276249d (diff)
downloadgit-14d30cdfc047fdff33c359f17cbb070f2faed009.zip
git-14d30cdfc047fdff33c359f17cbb070f2faed009.tar.gz
git-14d30cdfc047fdff33c359f17cbb070f2faed009.tar.bz2
ref-filter: fix memory leak in `free_array_item()`
We treat the `value` pointer as a pointer to a struct and free its `s` field. But `value` is in fact an array of structs. As a result, we only free the first `s` out of `used_atom_cnt`-many and leak the rest. Make sure we free all items in `value`. In the caller, `ref_array_clear()`, this means we need to be careful not to zero `used_atom_cnt` until after we've called `free_array_item()`. We could move just a single line, but let's keep related things close together instead, by first handling `array`, then `used_atom`. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6034-merge-rename-nocruft.sh')
0 files changed, 0 insertions, 0 deletions