From 2f7538ec00e8391c156bcdd64ae6dbb558758afe Mon Sep 17 00:00:00 2001 From: Philip Kelley Date: Tue, 6 Nov 2012 09:36:04 -0500 Subject: Fix connection leak in http subtransport --- src/netops.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/netops.c') diff --git a/src/netops.c b/src/netops.c index 3e2743486..2d079efab 100644 --- a/src/netops.c +++ b/src/netops.c @@ -193,16 +193,19 @@ void gitno_consume_n(gitno_buffer *buf, size_t cons) static int gitno_ssl_teardown(gitno_ssl *ssl) { int ret; - + do { ret = SSL_shutdown(ssl->ssl); } while (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_CTX_free(ssl->ctx); - return 0; + return ret; } /* Match host names according to RFC 2818 rules */ -- cgit v1.2.1