Commit 313440c394589af4387daa71b31821ed9b7f4462

Edward Thomson 2018-12-19T13:37:26

Merge pull request #4916 from libgit2/ethomson/backport_0278 smart transport: only clear url on hard reset

diff --git a/src/transports/smart.c b/src/transports/smart.c
index 5fedd39..b49e76e 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -45,14 +45,13 @@ GIT_INLINE(int) git_smart__reset_stream(transport_smart *t, bool close_subtransp
 		t->current_stream = NULL;
 	}
 
-	if (t->url) {
+	if (close_subtransport) {
 		git__free(t->url);
 		t->url = NULL;
-	}
 
-	if (close_subtransport &&
-		t->wrapped->close(t->wrapped) < 0)
-		return -1;
+		if (t->wrapped->close(t->wrapped) < 0)
+			return -1;
+	}
 
 	return 0;
 }