odb: handle NULL pointers passed to git_odb_stream_free Signed-off-by: Brodie Rao <brodie@sf.io>
diff --git a/src/odb.c b/src/odb.c
index b208b27..b413f83 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -949,6 +949,9 @@ int git_odb_stream_read(git_odb_stream *stream, char *buffer, size_t len)
void git_odb_stream_free(git_odb_stream *stream)
{
+ if (stream == NULL)
+ return;
+
git__free(stream->hash_ctx);
stream->free(stream);
}