diff options
author | Richard Levitte <levitte@openssl.org> | 2002-12-21 23:49:25 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-12-21 23:49:25 +0000 |
commit | 88a908e50d4e30d17bf62231921205b2c906b5c5 (patch) | |
tree | a69f6b90460ee08ec47b5a4ed83098f458fb18ac /ssl/s3_clnt.c | |
parent | d7de7bcf3e3966348ff6c792c523469cb936a315 (diff) |
Stop a possible memory leak.
(I wonder why s2_connect() handles the initial buffer allocation slightly
differently...)
PR: 416
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r-- | ssl/s3_clnt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 4d4a8d0f48..fae8eadada 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -164,7 +164,7 @@ SSL_METHOD *SSLv3_client_method(void) int ssl3_connect(SSL *s) { - BUF_MEM *buf; + BUF_MEM *buf=NULL; unsigned long Time=time(NULL),l; long num1; void (*cb)(const SSL *ssl,int type,int val)=NULL; @@ -225,6 +225,7 @@ int ssl3_connect(SSL *s) goto end; } s->init_buf=buf; + buf=NULL; } if (!ssl3_setup_buffers(s)) { ret= -1; goto end; } @@ -503,6 +504,8 @@ int ssl3_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); |