summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.cgi
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2026-07-19 01:08:42 +0000
committerJunio C Hamano <gitster@pobox.com>2026-07-19 16:26:09 -0700
commitfdfcd7543e8c2c045ea215b17e6e772a9770018a (patch)
treec9476214a8fbeff67feec0516fae24b55eefa1e4 /gitweb/gitweb.cgi
parent251e7af9924f9d3132a7b2f1f0f9563c829bc419 (diff)
rust: discard hash context when finished
When we allocate a context but then abandon it, we never discard it, which means that the underlying crypto library context may leak. This doesn't happen with our default block code, but it may with OpenSSL. Note that we do call git_hash_free, which frees the memory we called from git_hash_alloc, but doesn't discard the underlying context itself. This can be seen with the following command when compiling with OpenSSL and running with nightly Rust: RUSTFLAGS='-Z sanitizer=leak' cargo test Discard the context in our context handler. Note that it is fine to do so even after finalizing the context, so our final functions which take self instead of &mut self will not mishandle memory. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.cgi')
0 files changed, 0 insertions, 0 deletions