diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 10:02:07 -0400 |
commit | b548a1f11c06ccdfa4f52a539912d22d77ee309e (patch) | |
tree | 37ff8792ddf09e4805aa3ba76b805923d3c52734 /ssl/record/ssl3_buffer.c | |
parent | 33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff) |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/record/ssl3_buffer.c')
-rw-r--r-- | ssl/record/ssl3_buffer.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/ssl/record/ssl3_buffer.c b/ssl/record/ssl3_buffer.c index 732420e27b..5a8d34c6fb 100644 --- a/ssl/record/ssl3_buffer.c +++ b/ssl/record/ssl3_buffer.c @@ -122,8 +122,7 @@ void SSL3_BUFFER_set_data(SSL3_BUFFER *b, const unsigned char *d, int n) void SSL3_BUFFER_release(SSL3_BUFFER *b) { - if (b->buf != NULL) - OPENSSL_free(b->buf); + OPENSSL_free(b->buf); b->buf = NULL; } @@ -224,10 +223,8 @@ int ssl3_release_write_buffer(SSL *s) wb = RECORD_LAYER_get_wbuf(&s->rlayer); - if (wb->buf != NULL) { - OPENSSL_free(wb->buf); - wb->buf = NULL; - } + OPENSSL_free(wb->buf); + wb->buf = NULL; return 1; } @@ -236,9 +233,7 @@ int ssl3_release_read_buffer(SSL *s) SSL3_BUFFER *b; b = RECORD_LAYER_get_rbuf(&s->rlayer); - if (b->buf != NULL) { - OPENSSL_free(b->buf); - b->buf = NULL; - } + OPENSSL_free(b->buf); + b->buf = NULL; return 1; } |