summaryrefslogtreecommitdiff
path: root/t/unit-tests/u-oid-array.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2025-01-09 03:28:18 -0500
committerJunio C Hamano <gitster@pobox.com>2025-01-09 09:56:28 -0800
commit949bb8f74f6db7405d6ad8bbf02ebc42a947801d (patch)
tree7fe81c23c85ed333055e953eb16566ea768dddc8 /t/unit-tests/u-oid-array.c
parenta60673e9252b08d4eca90543b3729f4798b9aafd (diff)
run_diff_files(): delay allocation of combine_diff_path
While looping over the index entries, when we see a higher level stage the first thing we do is allocate a combine_diff_path struct for it. But this can leak; if check_removed() returns an error, we'll continue to the next iteration of the loop without cleaning up. We can fix this by just delaying the allocation by a few lines. I don't think this leak is triggered in the test suite, but it's pretty easy to see by inspection. My ulterior motive here is that the delayed allocation means we have all of the data needed to initialize "dpath" at the time of malloc, making it easier to factor out a constructor function. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/u-oid-array.c')
0 files changed, 0 insertions, 0 deletions