diff options
author | Richard Levitte <levitte@openssl.org> | 2002-12-21 23:49:21 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-12-21 23:49:21 +0000 |
commit | 8d6ad9e39d3e104427c133ac45ce05f30da9f9a3 (patch) | |
tree | f18a6ce6c1ff25b3b7503659e86783f05fda5dc3 /ssl/s2_clnt.c | |
parent | aa18245f7eb0837f1ddd3e057cc1e65bae4f821d (diff) | |
download | openssl-8d6ad9e39d3e104427c133ac45ce05f30da9f9a3.tar.gz |
Stop a possible memory leak.
(I wonder why s2_connect() handles the initial buffer allocation slightly
differently...)
PR: 416
Diffstat (limited to 'ssl/s2_clnt.c')
-rw-r--r-- | ssl/s2_clnt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c index da783230a5..0bc04d284e 100644 --- a/ssl/s2_clnt.c +++ b/ssl/s2_clnt.c @@ -208,10 +208,13 @@ int ssl2_connect(SSL *s) if (!BUF_MEM_grow(buf, SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER)) { + if (buf == s->init_buf) + buf=NULL; ret= -1; goto end; } s->init_buf=buf; + buf=NULL; s->init_num=0; s->state=SSL2_ST_SEND_CLIENT_HELLO_A; s->ctx->stats.sess_connect++; @@ -338,6 +341,8 @@ int ssl2_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); |