We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8092c43 + 2f3c4b6 commit da8138bCopy full SHA for da8138b
src/odb_loose.c
@@ -1028,11 +1028,15 @@ static int loose_backend__readstream(
1028
1029
done:
1030
if (error < 0) {
1031
- git_futils_mmap_free(&stream->map);
1032
- git_zstream_free(&stream->zstream);
1033
- git_hash_ctx_cleanup(hash_ctx);
1034
- git__free(hash_ctx);
1035
- git__free(stream);
+ if (stream) {
+ git_futils_mmap_free(&stream->map);
+ git_zstream_free(&stream->zstream);
+ git__free(stream);
+ }
1036
+ if (hash_ctx) {
1037
+ git_hash_ctx_cleanup(hash_ctx);
1038
+ git__free(hash_ctx);
1039
1040
}
1041
1042
git_buf_dispose(&object_path);
0 commit comments