Commit d39f643a0a09336ad77f04b7037cbc1c486bdd50

Carlos Martín Nieto 2015-10-13T19:34:07

stream: accept NULL in the free function

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