odb: handle NULL pointers passed to git_odb_stream_free

Signed-off-by: Brodie Rao <brodie@sf.io>
This commit is contained in:
Brodie Rao 2014-01-12 23:31:13 -08:00
parent e3c6a1bf02
commit ae3b6d612d

View File

@ -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) void git_odb_stream_free(git_odb_stream *stream)
{ {
if (stream == NULL)
return;
git__free(stream->hash_ctx); git__free(stream->hash_ctx);
stream->free(stream); stream->free(stream);
} }