summaryrefslogtreecommitdiffstats
path: root/ssl/s23_clnt.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-12-21 23:49:21 +0000
committerRichard Levitte <levitte@openssl.org>2002-12-21 23:49:21 +0000
commit8d6ad9e39d3e104427c133ac45ce05f30da9f9a3 (patch)
treef18a6ce6c1ff25b3b7503659e86783f05fda5dc3 /ssl/s23_clnt.c
parentaa18245f7eb0837f1ddd3e057cc1e65bae4f821d (diff)
Stop a possible memory leak.
(I wonder why s2_connect() handles the initial buffer allocation slightly differently...) PR: 416
Diffstat (limited to 'ssl/s23_clnt.c')
-rw-r--r--ssl/s23_clnt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c
index ffaf3baff3..64ee4269ec 100644
--- a/ssl/s23_clnt.c
+++ b/ssl/s23_clnt.c
@@ -105,7 +105,7 @@ SSL_METHOD *SSLv23_client_method(void)
int ssl23_connect(SSL *s)
{
- BUF_MEM *buf;
+ BUF_MEM *buf=NULL;
unsigned long Time=time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
@@ -159,6 +159,7 @@ int ssl23_connect(SSL *s)
goto end;
}
s->init_buf=buf;
+ buf=NULL;
}
if (!ssl3_setup_buffers(s)) { ret= -1; goto end; }
@@ -207,6 +208,8 @@ int ssl23_connect(SSL *s)
}
end:
s->in_handshake--;
+ if (buf != NULL)
+ BUF_MEM_free(buf);
if (cb != NULL)
cb(s,SSL_CB_CONNECT_EXIT,ret);
return(ret);