stream: accept NULL in the free function
diff --git a/src/stream.h b/src/stream.h
index 43fcc30..4692c71 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -62,6 +62,9 @@ GIT_INLINE(int) git_stream_close(git_stream *st)
GIT_INLINE(void) git_stream_free(git_stream *st)
{
+ if (!st)
+ return;
+
st->free(st);
}