mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-12 12:00:29 +00:00
Fix connection leak in http subtransport
This commit is contained in:
parent
091361f569
commit
2f7538ec00
@ -193,16 +193,19 @@ void gitno_consume_n(gitno_buffer *buf, size_t cons)
|
|||||||
static int gitno_ssl_teardown(gitno_ssl *ssl)
|
static int gitno_ssl_teardown(gitno_ssl *ssl)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ret = SSL_shutdown(ssl->ssl);
|
ret = SSL_shutdown(ssl->ssl);
|
||||||
} while (ret == 0);
|
} while (ret == 0);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ssl_set_error(ssl, ret);
|
ret = ssl_set_error(ssl, ret);
|
||||||
|
else
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
SSL_free(ssl->ssl);
|
SSL_free(ssl->ssl);
|
||||||
SSL_CTX_free(ssl->ctx);
|
SSL_CTX_free(ssl->ctx);
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Match host names according to RFC 2818 rules */
|
/* Match host names according to RFC 2818 rules */
|
||||||
|
@ -606,6 +606,9 @@ static void http_free(git_smart_subtransport *smart_transport)
|
|||||||
|
|
||||||
clear_parser_state(t);
|
clear_parser_state(t);
|
||||||
|
|
||||||
|
if (t->socket.socket)
|
||||||
|
gitno_close(&t->socket);
|
||||||
|
|
||||||
if (t->cred) {
|
if (t->cred) {
|
||||||
t->cred->free(t->cred);
|
t->cred->free(t->cred);
|
||||||
t->cred = NULL;
|
t->cred = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user