diff options
author | 2014-05-28 13:03:24 +0000 | |
---|---|---|
committer | 2014-05-28 13:03:24 +0000 | |
commit | 9d9224c34fa672afefd4702ccd40f7a3f0d33859 (patch) | |
tree | ceb592a1008435edad633dfdf1070ac72db0a1ed /lib/libssl/src/ssl/s3_both.c | |
parent | More KNF. (diff) | |
download | wireguard-openbsd-9d9224c34fa672afefd4702ccd40f7a3f0d33859.tar.xz wireguard-openbsd-9d9224c34fa672afefd4702ccd40f7a3f0d33859.zip |
There is no point in checking if a pointer is non-NULL before calling free,
since free already does this for us. Also remove some pointless NULL
assignments, where the result from malloc(3) is immediately assigned to the
same variable.
ok miod@
Diffstat (limited to 'lib/libssl/src/ssl/s3_both.c')
-rw-r--r-- | lib/libssl/src/ssl/s3_both.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libssl/src/ssl/s3_both.c b/lib/libssl/src/ssl/s3_both.c index 9dcdd7b998f..f1d686b56f6 100644 --- a/lib/libssl/src/ssl/s3_both.c +++ b/lib/libssl/src/ssl/s3_both.c @@ -719,20 +719,16 @@ ssl3_setup_buffers(SSL *s) int ssl3_release_write_buffer(SSL *s) { - if (s->s3->wbuf.buf != NULL) { - free(s->s3->wbuf.buf); - s->s3->wbuf.buf = NULL; - } + free(s->s3->wbuf.buf); + s->s3->wbuf.buf = NULL; return 1; } int ssl3_release_read_buffer(SSL *s) { - if (s->s3->rbuf.buf != NULL) { - free(s->s3->rbuf.buf); - s->s3->rbuf.buf = NULL; - } + free(s->s3->rbuf.buf); + s->s3->rbuf.buf = NULL; return 1; } |