diff --git a/src/libgit2/odb.c b/src/libgit2/odb.c index fec1e45b9..7e5677499 100644 --- a/src/libgit2/odb.c +++ b/src/libgit2/odb.c @@ -1796,7 +1796,8 @@ void git_odb_stream_free(git_odb_stream *stream) if (stream == NULL) return; - git_hash_ctx_cleanup(stream->hash_ctx); + if (stream->hash_ctx) + git_hash_ctx_cleanup(stream->hash_ctx); git__free(stream->hash_ctx); stream->free(stream); }