]> git.99rst.org Git - git.git/commit
commit-graph: avoid malloc'ing a local variable
authorJohannes Schindelin <redacted>
Thu, 15 May 2025 13:11:41 +0000 (13:11 +0000)
committerJunio C Hamano <redacted>
Thu, 15 May 2025 20:46:45 +0000 (13:46 -0700)
commit7f3ed75ff551e2ca4f8eb0242784e7aacbb14fb3
tree83a24a0ddadc8dcdb597747602ecf888eee556a5
parentc607410ada02fce5ee2366b68543736176101295
commit-graph: avoid malloc'ing a local variable

We do need a context to write the commit graph, but that context is only
needed during the life time of `commit_graph_write()`, therefore it can
easily be a stack variable.

This also helps CodeQL recognize that it is safe to assign the address
of other local variables to the context's fields.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
commit-graph.c
git clone https://git.99rst.org/PROJECT