Commit 45d295e08cc7bd8b2dc27ed88d067eff6991d5c8

Carlos Martín Nieto 2015-10-30T17:51:50

git: accept NULL as argument to its stream free

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/transports/git.c b/src/transports/git.c
index 52de92d..3e7e5a0 100644
--- a/src/transports/git.c
+++ b/src/transports/git.c
@@ -132,9 +132,9 @@ static void git_proto_stream_free(git_smart_subtransport_stream *stream)
 {
 	git_proto_stream *s = (git_proto_stream *)stream;
 	git_subtransport *t = OWNING_SUBTRANSPORT(s);
-	int ret;
 
-	GIT_UNUSED(ret);
+	if (!stream)
+		return;
 
 	t->current_stream = NULL;