summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/comp
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2014-04-17 13:37:48 +0000
committerbeck <beck@openbsd.org>2014-04-17 13:37:48 +0000
commit6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54 (patch)
treee7ca531f41f3403bf7f04411c40317e859a02460 /lib/libssl/src/crypto/comp
parentRevert unintended whitespace changes. (diff)
downloadwireguard-openbsd-6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54.tar.xz
wireguard-openbsd-6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54.zip
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
Diffstat (limited to 'lib/libssl/src/crypto/comp')
-rw-r--r--lib/libssl/src/crypto/comp/c_zlib.c26
-rw-r--r--lib/libssl/src/crypto/comp/comp_lib.c6
2 files changed, 16 insertions, 16 deletions
diff --git a/lib/libssl/src/crypto/comp/c_zlib.c b/lib/libssl/src/crypto/comp/c_zlib.c
index 8adf35f3fc9..2ced7c10cc3 100644
--- a/lib/libssl/src/crypto/comp/c_zlib.c
+++ b/lib/libssl/src/crypto/comp/c_zlib.c
@@ -37,7 +37,7 @@ static void* zlib_zalloc(void* opaque, unsigned int no, unsigned int size)
{
void *p;
- p=OPENSSL_malloc(no*size);
+ p=malloc(no*size);
if (p)
memset(p, 0, no*size);
return p;
@@ -46,7 +46,7 @@ static void* zlib_zalloc(void* opaque, unsigned int no, unsigned int size)
static void zlib_zfree(void* opaque, void* address)
{
- OPENSSL_free(address);
+ free(address);
}
#if 0
@@ -140,7 +140,7 @@ static int zlib_stateful_init(COMP_CTX *ctx)
{
int err;
struct zlib_state *state =
- (struct zlib_state *)OPENSSL_malloc(sizeof(struct zlib_state));
+ (struct zlib_state *)malloc(sizeof(struct zlib_state));
if (state == NULL)
goto err;
@@ -173,7 +173,7 @@ static int zlib_stateful_init(COMP_CTX *ctx)
CRYPTO_set_ex_data(&ctx->ex_data,zlib_stateful_ex_idx,state);
return 1;
err:
- if (state) OPENSSL_free(state);
+ if (state) free(state);
return 0;
}
@@ -184,7 +184,7 @@ static void zlib_stateful_finish(COMP_CTX *ctx)
zlib_stateful_ex_idx);
inflateEnd(&state->istream);
deflateEnd(&state->ostream);
- OPENSSL_free(state);
+ free(state);
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_COMP,ctx,&ctx->ex_data);
}
@@ -479,7 +479,7 @@ static int bio_zlib_new(BIO *bi)
return 0;
}
#endif
- ctx = OPENSSL_malloc(sizeof(BIO_ZLIB_CTX));
+ ctx = malloc(sizeof(BIO_ZLIB_CTX));
if(!ctx)
{
COMPerr(COMP_F_BIO_ZLIB_NEW, ERR_R_MALLOC_FAILURE);
@@ -518,15 +518,15 @@ static int bio_zlib_free(BIO *bi)
{
/* Destroy decompress context */
inflateEnd(&ctx->zin);
- OPENSSL_free(ctx->ibuf);
+ free(ctx->ibuf);
}
if(ctx->obuf)
{
/* Destroy compress context */
deflateEnd(&ctx->zout);
- OPENSSL_free(ctx->obuf);
+ free(ctx->obuf);
}
- OPENSSL_free(ctx);
+ free(ctx);
bi->ptr = NULL;
bi->init = 0;
bi->flags = 0;
@@ -544,7 +544,7 @@ static int bio_zlib_read(BIO *b, char *out, int outl)
BIO_clear_retry_flags(b);
if(!ctx->ibuf)
{
- ctx->ibuf = OPENSSL_malloc(ctx->ibufsize);
+ ctx->ibuf = malloc(ctx->ibufsize);
if(!ctx->ibuf)
{
COMPerr(COMP_F_BIO_ZLIB_READ, ERR_R_MALLOC_FAILURE);
@@ -606,7 +606,7 @@ static int bio_zlib_write(BIO *b, const char *in, int inl)
BIO_clear_retry_flags(b);
if(!ctx->obuf)
{
- ctx->obuf = OPENSSL_malloc(ctx->obufsize);
+ ctx->obuf = malloc(ctx->obufsize);
/* Need error here */
if(!ctx->obuf)
{
@@ -754,7 +754,7 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
{
if (ctx->ibuf)
{
- OPENSSL_free(ctx->ibuf);
+ free(ctx->ibuf);
ctx->ibuf = NULL;
}
ctx->ibufsize = ibs;
@@ -764,7 +764,7 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
{
if (ctx->obuf)
{
- OPENSSL_free(ctx->obuf);
+ free(ctx->obuf);
ctx->obuf = NULL;
}
ctx->obufsize = obs;
diff --git a/lib/libssl/src/crypto/comp/comp_lib.c b/lib/libssl/src/crypto/comp/comp_lib.c
index b60ae371e8d..feb07ea8813 100644
--- a/lib/libssl/src/crypto/comp/comp_lib.c
+++ b/lib/libssl/src/crypto/comp/comp_lib.c
@@ -8,7 +8,7 @@ COMP_CTX *COMP_CTX_new(COMP_METHOD *meth)
{
COMP_CTX *ret;
- if ((ret=(COMP_CTX *)OPENSSL_malloc(sizeof(COMP_CTX))) == NULL)
+ if ((ret=(COMP_CTX *)malloc(sizeof(COMP_CTX))) == NULL)
{
/* ZZZZZZZZZZZZZZZZ */
return(NULL);
@@ -17,7 +17,7 @@ COMP_CTX *COMP_CTX_new(COMP_METHOD *meth)
ret->meth=meth;
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
{
- OPENSSL_free(ret);
+ free(ret);
ret=NULL;
}
return(ret);
@@ -31,7 +31,7 @@ void COMP_CTX_free(COMP_CTX *ctx)
if (ctx->meth->finish != NULL)
ctx->meth->finish(ctx);
- OPENSSL_free(ctx);
+ free(ctx);
}
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,