git/src
brian m. carlson fdfcd7543e 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>
2026-07-19 16:26:09 -07:00
..
cargo-meson.sh rust: fix linking binaries with cargo 2026-02-07 17:41:02 -08:00
csum_file.rs rust: add a small wrapper around the hashfile code 2026-02-07 17:41:03 -08:00
hash.rs rust: discard hash context when finished 2026-07-19 16:26:09 -07:00
lib.rs rust: add a small wrapper around the hashfile code 2026-02-07 17:41:03 -08:00
loose.rs rust: add a new binary object map format 2026-02-07 17:41:03 -08:00
meson.build Enable Rust by default 2026-04-09 17:25:36 -07:00
varint.rs rust/varint: add safety comments 2025-10-15 08:10:17 -07:00