diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-28 15:28:14 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-28 15:28:14 -0400 |
commit | b196e7d936fb377d9c5b305748ac25ff0e53ef6d (patch) | |
tree | c855f0808899e5e7ef3a704c35f464ca36014964 /crypto/bio | |
parent | 3e47caff4830d2a117eda15b57a5feab89b846ae (diff) |
remove malloc casts
Following ANSI C rules, remove the casts from calls to
OPENSSL_malloc and OPENSSL_realloc.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bf_buff.c | 10 | ||||
-rw-r--r-- | crypto/bio/bf_lbuf.c | 6 | ||||
-rw-r--r-- | crypto/bio/bf_nbio.c | 2 | ||||
-rw-r--r-- | crypto/bio/bio_lib.c | 2 | ||||
-rw-r--r-- | crypto/bio/bss_acpt.c | 2 | ||||
-rw-r--r-- | crypto/bio/bss_conn.c | 2 | ||||
-rw-r--r-- | crypto/bio/bss_log.c | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c index 0e998d656a..d82385a06c 100644 --- a/crypto/bio/bf_buff.c +++ b/crypto/bio/bf_buff.c @@ -93,15 +93,15 @@ static int buffer_new(BIO *bi) { BIO_F_BUFFER_CTX *ctx; - ctx = (BIO_F_BUFFER_CTX *)OPENSSL_malloc(sizeof(BIO_F_BUFFER_CTX)); + ctx = OPENSSL_malloc(sizeof(BIO_F_BUFFER_CTX)); if (ctx == NULL) return (0); - ctx->ibuf = (char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE); + ctx->ibuf = OPENSSL_malloc(DEFAULT_BUFFER_SIZE); if (ctx->ibuf == NULL) { OPENSSL_free(ctx); return (0); } - ctx->obuf = (char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE); + ctx->obuf = OPENSSL_malloc(DEFAULT_BUFFER_SIZE); if (ctx->obuf == NULL) { OPENSSL_free(ctx->ibuf); OPENSSL_free(ctx); @@ -366,12 +366,12 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr) p1 = ctx->ibuf; p2 = ctx->obuf; if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) { - p1 = (char *)OPENSSL_malloc((int)num); + p1 = OPENSSL_malloc((int)num); if (p1 == NULL) goto malloc_error; } if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { - p2 = (char *)OPENSSL_malloc((int)num); + p2 = OPENSSL_malloc((int)num); if (p2 == NULL) { if (p1 != ctx->ibuf) OPENSSL_free(p1); diff --git a/crypto/bio/bf_lbuf.c b/crypto/bio/bf_lbuf.c index 3b75b7efc8..ef12820b50 100644 --- a/crypto/bio/bf_lbuf.c +++ b/crypto/bio/bf_lbuf.c @@ -104,10 +104,10 @@ static int linebuffer_new(BIO *bi) { BIO_LINEBUFFER_CTX *ctx; - ctx = (BIO_LINEBUFFER_CTX *)OPENSSL_malloc(sizeof(BIO_LINEBUFFER_CTX)); + ctx = OPENSSL_malloc(sizeof(BIO_LINEBUFFER_CTX)); if (ctx == NULL) return (0); - ctx->obuf = (char *)OPENSSL_malloc(DEFAULT_LINEBUFFER_SIZE); + ctx->obuf = OPENSSL_malloc(DEFAULT_LINEBUFFER_SIZE); if (ctx->obuf == NULL) { OPENSSL_free(ctx); return (0); @@ -278,7 +278,7 @@ static long linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr) obs = (int)num; p = ctx->obuf; if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) { - p = (char *)OPENSSL_malloc((int)num); + p = OPENSSL_malloc((int)num); if (p == NULL) goto malloc_error; } diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c index 0ba6055e07..df547a1027 100644 --- a/crypto/bio/bf_nbio.c +++ b/crypto/bio/bf_nbio.c @@ -102,7 +102,7 @@ static int nbiof_new(BIO *bi) { NBIO_TEST *nt; - if (!(nt = (NBIO_TEST *)OPENSSL_malloc(sizeof(NBIO_TEST)))) + if (!(nt = OPENSSL_malloc(sizeof(NBIO_TEST)))) return (0); nt->lrn = -1; nt->lwn = -1; diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index a5d8680d48..e7957a7678 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -67,7 +67,7 @@ BIO *BIO_new(BIO_METHOD *method) { BIO *ret = NULL; - ret = (BIO *)OPENSSL_malloc(sizeof(BIO)); + ret = OPENSSL_malloc(sizeof(BIO)); if (ret == NULL) { BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); return (NULL); diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 72f7bd21de..d6f66789d8 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -137,7 +137,7 @@ static BIO_ACCEPT *BIO_ACCEPT_new(void) { BIO_ACCEPT *ret; - if ((ret = (BIO_ACCEPT *)OPENSSL_malloc(sizeof(BIO_ACCEPT))) == NULL) + if ((ret = OPENSSL_malloc(sizeof(BIO_ACCEPT))) == NULL) return (NULL); memset(ret, 0, sizeof(BIO_ACCEPT)); diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index e95b4b38d6..e44bb32dca 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -287,7 +287,7 @@ BIO_CONNECT *BIO_CONNECT_new(void) { BIO_CONNECT *ret; - if ((ret = (BIO_CONNECT *)OPENSSL_malloc(sizeof(BIO_CONNECT))) == NULL) + if ((ret = OPENSSL_malloc(sizeof(BIO_CONNECT))) == NULL) return (NULL); ret->state = BIO_CONN_S_BEFORE; ret->param_hostname = NULL; diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index 5f9ab5729f..2399ff8b10 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -239,7 +239,7 @@ static int slg_write(BIO *b, const char *in, int inl) /* The default */ }; - if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) { + if ((buf = OPENSSL_malloc(inl + 1)) == NULL) { return (0); } strncpy(buf, in, inl); |