Commit ca2eb4608243162a13c427e74526b6422d5a6659

Edward Thomson 2018-07-20T21:50:58

smart subtransport: free url when resetting stream Free the url field when resetting the stream to avoid leaking it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/transports/smart.c b/src/transports/smart.c
index be3f9c8..a9459c4 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -45,6 +45,11 @@ GIT_INLINE(int) git_smart__reset_stream(transport_smart *t, bool close_subtransp
 		t->current_stream = NULL;
 	}
 
+	if (t->url) {
+		git__free(t->url);
+		t->url = NULL;
+	}
+
 	if (close_subtransport &&
 		t->wrapped->close(t->wrapped) < 0)
 		return -1;