summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-05 12:09:04 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-05 08:49:11 -0700
commit49d47eb5416d22f185877a57380a1ffc28f172e1 (patch)
treedf343a69aee235de263645f3789b11b01e669a74 /commit.c
parent42c153e1c06fcfea8446f11bf3fc3bcf9ea25867 (diff)
send-pack: fix leaking push cert nonce
When retrieving the push cert nonce from the server, we first store the constant returned by `server_feature_value()` and then, if the nonce is valid, we duplicate the nonce memory to a NUL-terminated string, so that we can pass it to `generate_push_cert()`. We never free the latter and thus cause a memory leak. Fix this by storing the limited-lifetime nonce into a scope-local variable such that the long-lived, allocated nonce can be easily freed without having to cast away its constness. This leak was exposed by t5534, but fixing it is not sufficient to make the whole test suite leak free. 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