From ae3b6d612db6305a20e1139503b3c9e99cf4632a Mon Sep 17 00:00:00 2001 From: Brodie Rao Date: Sun, 12 Jan 2014 23:31:13 -0800 Subject: [PATCH] odb: handle NULL pointers passed to git_odb_stream_free Signed-off-by: Brodie Rao --- src/odb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/odb.c b/src/odb.c index b208b279e..b413f83b4 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); }