summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrodie Rao <brodie@sf.io>2014-01-12 23:31:13 -0800
committerBrodie Rao <brodie@sf.io>2014-01-12 23:33:59 -0800
commitae3b6d612db6305a20e1139503b3c9e99cf4632a (patch)
tree727c30dd0e597698cfed12f48d755de80410da44 /src
parente3c6a1bf02227cf996a5c0da784124ddea5c1ba6 (diff)
downloadlibgit2-ae3b6d612db6305a20e1139503b3c9e99cf4632a.tar.gz
odb: handle NULL pointers passed to git_odb_stream_free
Signed-off-by: Brodie Rao <brodie@sf.io>
Diffstat (limited to 'src')
-rw-r--r--src/odb.c3
1 files changed, 3 insertions, 0 deletions
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);
}