Commit 76e65090 authored by Matt Caswell's avatar Matt Caswell
Browse files

Fix memory leak in SSL_new if errors occur.

parent 7bca0a1d
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -417,13 +417,7 @@ SSL *SSL_new(SSL_CTX *ctx)
	return(s);
err:
	if (s != NULL)
		{
		if (s->cert != NULL)
			ssl_cert_free(s->cert);
		if (s->ctx != NULL)
			SSL_CTX_free(s->ctx); /* decrement reference count */
		OPENSSL_free(s);
		}
		SSL_free(s);
	SSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE);
	return(NULL);
	}