Commit ae3b6d612db6305a20e1139503b3c9e99cf4632a

Brodie Rao 2014-01-12T23:31:13

odb: handle NULL pointers passed to git_odb_stream_free Signed-off-by: Brodie Rao <brodie@sf.io>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
 }