From bddb7c686e3d1aeb156722adc64b6c35ae720f87 Mon Sep 17 00:00:00 2001 From: beck <> Date: Thu, 17 Apr 2014 13:37:50 +0000 Subject: Change library to use intrinsic memory allocation functions instead of OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free --- src/lib/libcrypto/bio/bf_buff.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/lib/libcrypto/bio/bf_buff.c') diff --git a/src/lib/libcrypto/bio/bf_buff.c b/src/lib/libcrypto/bio/bf_buff.c index 937a1c58d5..be2ebab148 100644 --- a/src/lib/libcrypto/bio/bf_buff.c +++ b/src/lib/libcrypto/bio/bf_buff.c @@ -95,18 +95,18 @@ buffer_new(BIO *bi) { BIO_F_BUFFER_CTX *ctx; - ctx = (BIO_F_BUFFER_CTX *)OPENSSL_malloc(sizeof(BIO_F_BUFFER_CTX)); + ctx = (BIO_F_BUFFER_CTX *)malloc(sizeof(BIO_F_BUFFER_CTX)); if (ctx == NULL) return (0); - ctx->ibuf = (char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE); + ctx->ibuf = (char *)malloc(DEFAULT_BUFFER_SIZE); if (ctx->ibuf == NULL) { - OPENSSL_free(ctx); + free(ctx); return (0); } - ctx->obuf = (char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE); + ctx->obuf = (char *)malloc(DEFAULT_BUFFER_SIZE); if (ctx->obuf == NULL) { - OPENSSL_free(ctx->ibuf); - OPENSSL_free(ctx); + free(ctx->ibuf); + free(ctx); return (0); } ctx->ibuf_size = DEFAULT_BUFFER_SIZE; @@ -131,10 +131,10 @@ buffer_free(BIO *a) return (0); b = (BIO_F_BUFFER_CTX *)a->ptr; if (b->ibuf != NULL) - OPENSSL_free(b->ibuf); + free(b->ibuf); if (b->obuf != NULL) - OPENSSL_free(b->obuf); - OPENSSL_free(a->ptr); + free(b->obuf); + free(a->ptr); a->ptr = NULL; a->init = 0; a->flags = 0; @@ -339,11 +339,11 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) break; case BIO_C_SET_BUFF_READ_DATA: if (num > ctx->ibuf_size) { - p1 = OPENSSL_malloc((int)num); + p1 = malloc((int)num); if (p1 == NULL) goto malloc_error; if (ctx->ibuf != NULL) - OPENSSL_free(ctx->ibuf); + free(ctx->ibuf); ctx->ibuf = p1; } ctx->ibuf_off = 0; @@ -370,27 +370,27 @@ 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 = (char *)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 = (char *)malloc((int)num); if (p2 == NULL) { if (p1 != ctx->ibuf) - OPENSSL_free(p1); + free(p1); goto malloc_error; } } if (ctx->ibuf != p1) { - OPENSSL_free(ctx->ibuf); + free(ctx->ibuf); ctx->ibuf = p1; ctx->ibuf_off = 0; ctx->ibuf_len = 0; ctx->ibuf_size = ibs; } if (ctx->obuf != p2) { - OPENSSL_free(ctx->obuf); + free(ctx->obuf); ctx->obuf = p2; ctx->obuf_off = 0; ctx->obuf_len = 0; -- cgit v1.2.3-55-g6feb