Unverified Commit 782c4d4d by Edward Thomson Committed by GitHub

Merge pull request #6599 from steven9724/fix-ssh-memleak

ssh: fix known_hosts leak in _git_ssh_setup_conn
parents 593ff41b 1a146417
...@@ -877,11 +877,12 @@ static int _git_ssh_setup_conn( ...@@ -877,11 +877,12 @@ static int _git_ssh_setup_conn(
t->current_stream = s; t->current_stream = s;
done: done:
if (known_hosts)
libssh2_knownhost_free(known_hosts);
if (error < 0) { if (error < 0) {
ssh_stream_free(*stream); ssh_stream_free(*stream);
if (known_hosts)
libssh2_knownhost_free(known_hosts);
if (session) if (session)
libssh2_session_free(session); libssh2_session_free(session);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment