Commit deecaa2eceac3c9d8fff8063132786e62c6b3ce2

Carlos Martín Nieto 2016-02-19T13:31:54

openssl: free the context even if we don't connect

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/openssl_stream.c b/src/openssl_stream.c
index 0705d90..58b70f5 100644
--- a/src/openssl_stream.c
+++ b/src/openssl_stream.c
@@ -267,7 +267,6 @@ static int ssl_teardown(SSL *ssl)
 	else
 		ret = 0;
 
-	SSL_free(ssl);
 	return ret;
 }
 
@@ -530,6 +529,7 @@ void openssl_free(git_stream *stream)
 {
 	openssl_stream *st = (openssl_stream *) stream;
 
+	SSL_free(st->ssl);
 	git__free(st->host);
 	git__free(st->cert_info.data);
 	git_stream_free(st->io);