Merge pull request #4880 from libgit2/ethomson/smart_transport_url smart transport: only clear url on hard reset (regression)
diff --git a/src/transports/smart.c b/src/transports/smart.c
index a9459c4..e972d30 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;
}