diff options
author | beck <> | 2014-04-17 13:37:50 +0000 |
---|---|---|
committer | beck <> | 2014-04-17 13:37:50 +0000 |
commit | bddb7c686e3d1aeb156722adc64b6c35ae720f87 (patch) | |
tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libcrypto/bio/bf_buff.c | |
parent | ecec66222d758996a4ff2671ca5026d9ede5ef76 (diff) | |
download | openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.gz openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.bz2 openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.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 'src/lib/libcrypto/bio/bf_buff.c')
-rw-r--r-- | src/lib/libcrypto/bio/bf_buff.c | 32 |
1 files changed, 16 insertions, 16 deletions
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) | |||
95 | { | 95 | { |
96 | BIO_F_BUFFER_CTX *ctx; | 96 | BIO_F_BUFFER_CTX *ctx; |
97 | 97 | ||
98 | ctx = (BIO_F_BUFFER_CTX *)OPENSSL_malloc(sizeof(BIO_F_BUFFER_CTX)); | 98 | ctx = (BIO_F_BUFFER_CTX *)malloc(sizeof(BIO_F_BUFFER_CTX)); |
99 | if (ctx == NULL) | 99 | if (ctx == NULL) |
100 | return (0); | 100 | return (0); |
101 | ctx->ibuf = (char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE); | 101 | ctx->ibuf = (char *)malloc(DEFAULT_BUFFER_SIZE); |
102 | if (ctx->ibuf == NULL) { | 102 | if (ctx->ibuf == NULL) { |
103 | OPENSSL_free(ctx); | 103 | free(ctx); |
104 | return (0); | 104 | return (0); |
105 | } | 105 | } |
106 | ctx->obuf = (char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE); | 106 | ctx->obuf = (char *)malloc(DEFAULT_BUFFER_SIZE); |
107 | if (ctx->obuf == NULL) { | 107 | if (ctx->obuf == NULL) { |
108 | OPENSSL_free(ctx->ibuf); | 108 | free(ctx->ibuf); |
109 | OPENSSL_free(ctx); | 109 | free(ctx); |
110 | return (0); | 110 | return (0); |
111 | } | 111 | } |
112 | ctx->ibuf_size = DEFAULT_BUFFER_SIZE; | 112 | ctx->ibuf_size = DEFAULT_BUFFER_SIZE; |
@@ -131,10 +131,10 @@ buffer_free(BIO *a) | |||
131 | return (0); | 131 | return (0); |
132 | b = (BIO_F_BUFFER_CTX *)a->ptr; | 132 | b = (BIO_F_BUFFER_CTX *)a->ptr; |
133 | if (b->ibuf != NULL) | 133 | if (b->ibuf != NULL) |
134 | OPENSSL_free(b->ibuf); | 134 | free(b->ibuf); |
135 | if (b->obuf != NULL) | 135 | if (b->obuf != NULL) |
136 | OPENSSL_free(b->obuf); | 136 | free(b->obuf); |
137 | OPENSSL_free(a->ptr); | 137 | free(a->ptr); |
138 | a->ptr = NULL; | 138 | a->ptr = NULL; |
139 | a->init = 0; | 139 | a->init = 0; |
140 | a->flags = 0; | 140 | a->flags = 0; |
@@ -339,11 +339,11 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
339 | break; | 339 | break; |
340 | case BIO_C_SET_BUFF_READ_DATA: | 340 | case BIO_C_SET_BUFF_READ_DATA: |
341 | if (num > ctx->ibuf_size) { | 341 | if (num > ctx->ibuf_size) { |
342 | p1 = OPENSSL_malloc((int)num); | 342 | p1 = malloc((int)num); |
343 | if (p1 == NULL) | 343 | if (p1 == NULL) |
344 | goto malloc_error; | 344 | goto malloc_error; |
345 | if (ctx->ibuf != NULL) | 345 | if (ctx->ibuf != NULL) |
346 | OPENSSL_free(ctx->ibuf); | 346 | free(ctx->ibuf); |
347 | ctx->ibuf = p1; | 347 | ctx->ibuf = p1; |
348 | } | 348 | } |
349 | ctx->ibuf_off = 0; | 349 | ctx->ibuf_off = 0; |
@@ -370,27 +370,27 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
370 | p1 = ctx->ibuf; | 370 | p1 = ctx->ibuf; |
371 | p2 = ctx->obuf; | 371 | p2 = ctx->obuf; |
372 | if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) { | 372 | if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) { |
373 | p1 = (char *)OPENSSL_malloc((int)num); | 373 | p1 = (char *)malloc((int)num); |
374 | if (p1 == NULL) | 374 | if (p1 == NULL) |
375 | goto malloc_error; | 375 | goto malloc_error; |
376 | } | 376 | } |
377 | if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { | 377 | if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { |
378 | p2 = (char *)OPENSSL_malloc((int)num); | 378 | p2 = (char *)malloc((int)num); |
379 | if (p2 == NULL) { | 379 | if (p2 == NULL) { |
380 | if (p1 != ctx->ibuf) | 380 | if (p1 != ctx->ibuf) |
381 | OPENSSL_free(p1); | 381 | free(p1); |
382 | goto malloc_error; | 382 | goto malloc_error; |
383 | } | 383 | } |
384 | } | 384 | } |
385 | if (ctx->ibuf != p1) { | 385 | if (ctx->ibuf != p1) { |
386 | OPENSSL_free(ctx->ibuf); | 386 | free(ctx->ibuf); |
387 | ctx->ibuf = p1; | 387 | ctx->ibuf = p1; |
388 | ctx->ibuf_off = 0; | 388 | ctx->ibuf_off = 0; |
389 | ctx->ibuf_len = 0; | 389 | ctx->ibuf_len = 0; |
390 | ctx->ibuf_size = ibs; | 390 | ctx->ibuf_size = ibs; |
391 | } | 391 | } |
392 | if (ctx->obuf != p2) { | 392 | if (ctx->obuf != p2) { |
393 | OPENSSL_free(ctx->obuf); | 393 | free(ctx->obuf); |
394 | ctx->obuf = p2; | 394 | ctx->obuf = p2; |
395 | ctx->obuf_off = 0; | 395 | ctx->obuf_off = 0; |
396 | ctx->obuf_len = 0; | 396 | ctx->obuf_len = 0; |