summaryrefslogtreecommitdiffstats
path: root/ssl/record/record_locl.h
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-05-21 14:06:52 +0100
committerMatt Caswell <matt@openssl.org>2015-05-22 08:08:45 +0100
commit6b41b3f5eacc6b1bb851c9dce22d6e893f32ea7d (patch)
tree6ff560441aeed681a5e56e30b3974fa90d6d9271 /ssl/record/record_locl.h
parent3a752c85ee38a92d7777b8fe1cce2e54bf619529 (diff)
Fix a memory leak in compression
The function RECORD_LAYER_clear() is supposed to clear the contents of the RECORD_LAYER structure, but retain certain data such as buffers that are allocated. Unfortunately one buffer (for compression) got missed and was inadvertently being wiped, thus causing a memory leak. In part this is due to the fact that RECORD_LAYER_clear() was reaching inside SSL3_BUFFERs and SSL3_RECORDs, which it really shouldn't. So, I've rewritten it to only clear the data it knows about, and to defer clearing of SSL3_RECORD and SSL3_BUFFER structures to SSL_RECORD_clear() and the new function SSL3_BUFFER_clear(). Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/record/record_locl.h')
-rw-r--r--ssl/record/record_locl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ssl/record/record_locl.h b/ssl/record/record_locl.h
index b2222d7c22..f92e89d86f 100644
--- a/ssl/record/record_locl.h
+++ b/ssl/record/record_locl.h
@@ -162,6 +162,7 @@ void dtls1_record_bitmap_update(SSL *s, DTLS1_BITMAP *bitmap);
#define SSL3_BUFFER_add_offset(b, o) ((b)->offset += (o))
#define SSL3_BUFFER_is_initialised(b) ((b)->buf != NULL)
+void SSL3_BUFFER_clear(SSL3_BUFFER *b);
void SSL3_BUFFER_set_data(SSL3_BUFFER *b, const unsigned char *d, int n);
void SSL3_BUFFER_release(SSL3_BUFFER *b);
__owur int ssl3_setup_read_buffer(SSL *s);