diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-07-20 21:50:58 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-07-20 13:57:25 -0700 |
commit | ca2eb4608243162a13c427e74526b6422d5a6659 (patch) | |
tree | 55208464869fec29f423316083bdf85ffbf6ba8c | |
parent | ea9e2c1a4a16b572a3621d9bd7b1383365701b9e (diff) | |
download | libgit2-ca2eb4608243162a13c427e74526b6422d5a6659.tar.gz |
smart subtransport: free url when resetting stream
Free the url field when resetting the stream to avoid leaking it.
-rw-r--r-- | src/transports/smart.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/transports/smart.c b/src/transports/smart.c index be3f9c8a8..a9459c433 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; |