summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bf_buff.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-09-03 15:15:26 +0200
committerRich Salz <rsalz@openssl.org>2015-09-03 22:26:34 +0200
commit64b25758edca688a30f02c260262150f7ad0bc7d (patch)
tree15ad5a8c7985e2b27aaf7a14737fd980a36349dd /crypto/bio/bf_buff.c
parentAdd UEFI flag for rand build (diff)
downloadopenssl-64b25758edca688a30f02c260262150f7ad0bc7d.tar.xz
openssl-64b25758edca688a30f02c260262150f7ad0bc7d.zip
remove 0 assignments.
After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/bio/bf_buff.c')
-rw-r--r--crypto/bio/bf_buff.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c
index 4fd8d15405..b7a3772979 100644
--- a/crypto/bio/bf_buff.c
+++ b/crypto/bio/bf_buff.c
@@ -91,27 +91,23 @@ BIO_METHOD *BIO_f_buffer(void)
static int buffer_new(BIO *bi)
{
- BIO_F_BUFFER_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
+ BIO_F_BUFFER_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
if (ctx == NULL)
return (0);
+ ctx->ibuf_size = DEFAULT_BUFFER_SIZE;
ctx->ibuf = OPENSSL_malloc(DEFAULT_BUFFER_SIZE);
if (ctx->ibuf == NULL) {
OPENSSL_free(ctx);
return (0);
}
+ ctx->obuf_size = DEFAULT_BUFFER_SIZE;
ctx->obuf = OPENSSL_malloc(DEFAULT_BUFFER_SIZE);
if (ctx->obuf == NULL) {
OPENSSL_free(ctx->ibuf);
OPENSSL_free(ctx);
return (0);
}
- ctx->ibuf_size = DEFAULT_BUFFER_SIZE;
- ctx->obuf_size = DEFAULT_BUFFER_SIZE;
- ctx->ibuf_len = 0;
- ctx->ibuf_off = 0;
- ctx->obuf_len = 0;
- ctx->obuf_off = 0;
bi->init = 1;
bi->ptr = (char *)ctx;