diff options
Diffstat (limited to 'src/lib/libcrypto/bio')
| -rw-r--r-- | src/lib/libcrypto/bio/b_print.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/b_sock.c | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bf_buff.c | 32 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bf_lbuf.c | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bf_nbio.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_acpt.c | 10 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_bio.c | 12 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_conn.c | 18 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_dgram.c | 22 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_log.c | 4 |
11 files changed, 68 insertions, 68 deletions
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c index 55a5ca1a32..ff0089e82e 100644 --- a/src/lib/libcrypto/bio/b_print.c +++ b/src/lib/libcrypto/bio/b_print.c | |||
| @@ -706,7 +706,7 @@ doapr_outch(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, | |||
| 706 | if (*buffer == NULL) { | 706 | if (*buffer == NULL) { |
| 707 | if (*maxlen == 0) | 707 | if (*maxlen == 0) |
| 708 | *maxlen = 1024; | 708 | *maxlen = 1024; |
| 709 | *buffer = OPENSSL_malloc(*maxlen); | 709 | *buffer = malloc(*maxlen); |
| 710 | if (*currlen > 0) { | 710 | if (*currlen > 0) { |
| 711 | assert(*sbuffer != NULL); | 711 | assert(*sbuffer != NULL); |
| 712 | memcpy(*buffer, *sbuffer, *currlen); | 712 | memcpy(*buffer, *sbuffer, *currlen); |
| @@ -714,7 +714,7 @@ doapr_outch(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, | |||
| 714 | *sbuffer = NULL; | 714 | *sbuffer = NULL; |
| 715 | } else { | 715 | } else { |
| 716 | *maxlen += 1024; | 716 | *maxlen += 1024; |
| 717 | *buffer = OPENSSL_realloc(*buffer, *maxlen); | 717 | *buffer = realloc(*buffer, *maxlen); |
| 718 | } | 718 | } |
| 719 | } | 719 | } |
| 720 | /* What to do if *buffer is NULL? */ | 720 | /* What to do if *buffer is NULL? */ |
| @@ -764,7 +764,7 @@ int BIO_vprintf (BIO *bio, const char *format, va_list args) | |||
| 764 | format, args); | 764 | format, args); |
| 765 | if (dynbuf) { | 765 | if (dynbuf) { |
| 766 | ret = BIO_write(bio, dynbuf, (int)retlen); | 766 | ret = BIO_write(bio, dynbuf, (int)retlen); |
| 767 | OPENSSL_free(dynbuf); | 767 | free(dynbuf); |
| 768 | } else { | 768 | } else { |
| 769 | ret = BIO_write(bio, hugebuf, (int)retlen); | 769 | ret = BIO_write(bio, hugebuf, (int)retlen); |
| 770 | } | 770 | } |
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c index b08226d52b..1ae9d96577 100644 --- a/src/lib/libcrypto/bio/b_sock.c +++ b/src/lib/libcrypto/bio/b_sock.c | |||
| @@ -490,7 +490,7 @@ again: | |||
| 490 | ret = 1; | 490 | ret = 1; |
| 491 | err: | 491 | err: |
| 492 | if (str != NULL) | 492 | if (str != NULL) |
| 493 | OPENSSL_free(str); | 493 | free(str); |
| 494 | if ((ret == 0) && (s != -1)) { | 494 | if ((ret == 0) && (s != -1)) { |
| 495 | close(s); | 495 | close(s); |
| 496 | s = -1; | 496 | s = -1; |
| @@ -591,9 +591,9 @@ BIO_accept(int sock, char **addr) | |||
| 591 | p = *addr; | 591 | p = *addr; |
| 592 | if (p) { | 592 | if (p) { |
| 593 | *p = '\0'; | 593 | *p = '\0'; |
| 594 | p = OPENSSL_realloc(p, nl); | 594 | p = realloc(p, nl); |
| 595 | } else { | 595 | } else { |
| 596 | p = OPENSSL_malloc(nl); | 596 | p = malloc(nl); |
| 597 | } | 597 | } |
| 598 | if (p == NULL) { | 598 | if (p == NULL) { |
| 599 | BIOerr(BIO_F_BIO_ACCEPT, ERR_R_MALLOC_FAILURE); | 599 | BIOerr(BIO_F_BIO_ACCEPT, ERR_R_MALLOC_FAILURE); |
| @@ -609,7 +609,7 @@ BIO_accept(int sock, char **addr) | |||
| 609 | l = ntohl(sa.from.sa_in.sin_addr.s_addr); | 609 | l = ntohl(sa.from.sa_in.sin_addr.s_addr); |
| 610 | port = ntohs(sa.from.sa_in.sin_port); | 610 | port = ntohs(sa.from.sa_in.sin_port); |
| 611 | if (*addr == NULL) { | 611 | if (*addr == NULL) { |
| 612 | if ((p = OPENSSL_malloc(24)) == NULL) { | 612 | if ((p = malloc(24)) == NULL) { |
| 613 | BIOerr(BIO_F_BIO_ACCEPT, ERR_R_MALLOC_FAILURE); | 613 | BIOerr(BIO_F_BIO_ACCEPT, ERR_R_MALLOC_FAILURE); |
| 614 | goto end; | 614 | goto end; |
| 615 | } | 615 | } |
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; |
diff --git a/src/lib/libcrypto/bio/bf_lbuf.c b/src/lib/libcrypto/bio/bf_lbuf.c index 006ed9d91c..5020795ded 100644 --- a/src/lib/libcrypto/bio/bf_lbuf.c +++ b/src/lib/libcrypto/bio/bf_lbuf.c | |||
| @@ -106,12 +106,12 @@ linebuffer_new(BIO *bi) | |||
| 106 | { | 106 | { |
| 107 | BIO_LINEBUFFER_CTX *ctx; | 107 | BIO_LINEBUFFER_CTX *ctx; |
| 108 | 108 | ||
| 109 | ctx = (BIO_LINEBUFFER_CTX *)OPENSSL_malloc(sizeof(BIO_LINEBUFFER_CTX)); | 109 | ctx = (BIO_LINEBUFFER_CTX *)malloc(sizeof(BIO_LINEBUFFER_CTX)); |
| 110 | if (ctx == NULL) | 110 | if (ctx == NULL) |
| 111 | return (0); | 111 | return (0); |
| 112 | ctx->obuf = (char *)OPENSSL_malloc(DEFAULT_LINEBUFFER_SIZE); | 112 | ctx->obuf = (char *)malloc(DEFAULT_LINEBUFFER_SIZE); |
| 113 | if (ctx->obuf == NULL) { | 113 | if (ctx->obuf == NULL) { |
| 114 | OPENSSL_free(ctx); | 114 | free(ctx); |
| 115 | return (0); | 115 | return (0); |
| 116 | } | 116 | } |
| 117 | ctx->obuf_size = DEFAULT_LINEBUFFER_SIZE; | 117 | ctx->obuf_size = DEFAULT_LINEBUFFER_SIZE; |
| @@ -132,8 +132,8 @@ linebuffer_free(BIO *a) | |||
| 132 | return (0); | 132 | return (0); |
| 133 | b = (BIO_LINEBUFFER_CTX *)a->ptr; | 133 | b = (BIO_LINEBUFFER_CTX *)a->ptr; |
| 134 | if (b->obuf != NULL) | 134 | if (b->obuf != NULL) |
| 135 | OPENSSL_free(b->obuf); | 135 | free(b->obuf); |
| 136 | OPENSSL_free(a->ptr); | 136 | free(a->ptr); |
| 137 | a->ptr = NULL; | 137 | a->ptr = NULL; |
| 138 | a->init = 0; | 138 | a->init = 0; |
| 139 | a->flags = 0; | 139 | a->flags = 0; |
| @@ -299,7 +299,7 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 299 | obs = (int)num; | 299 | obs = (int)num; |
| 300 | p = ctx->obuf; | 300 | p = ctx->obuf; |
| 301 | if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) { | 301 | if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) { |
| 302 | p = (char *)OPENSSL_malloc((int)num); | 302 | p = (char *)malloc((int)num); |
| 303 | if (p == NULL) | 303 | if (p == NULL) |
| 304 | goto malloc_error; | 304 | goto malloc_error; |
| 305 | } | 305 | } |
| @@ -308,7 +308,7 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 308 | ctx->obuf_len = obs; | 308 | ctx->obuf_len = obs; |
| 309 | } | 309 | } |
| 310 | memcpy(p, ctx->obuf, ctx->obuf_len); | 310 | memcpy(p, ctx->obuf, ctx->obuf_len); |
| 311 | OPENSSL_free(ctx->obuf); | 311 | free(ctx->obuf); |
| 312 | ctx->obuf = p; | 312 | ctx->obuf = p; |
| 313 | ctx->obuf_size = obs; | 313 | ctx->obuf_size = obs; |
| 314 | } | 314 | } |
diff --git a/src/lib/libcrypto/bio/bf_nbio.c b/src/lib/libcrypto/bio/bf_nbio.c index d181f518ec..200ca706ff 100644 --- a/src/lib/libcrypto/bio/bf_nbio.c +++ b/src/lib/libcrypto/bio/bf_nbio.c | |||
| @@ -104,7 +104,7 @@ nbiof_new(BIO *bi) | |||
| 104 | { | 104 | { |
| 105 | NBIO_TEST *nt; | 105 | NBIO_TEST *nt; |
| 106 | 106 | ||
| 107 | if (!(nt = (NBIO_TEST *)OPENSSL_malloc(sizeof(NBIO_TEST)))) | 107 | if (!(nt = (NBIO_TEST *)malloc(sizeof(NBIO_TEST)))) |
| 108 | return (0); | 108 | return (0); |
| 109 | nt->lrn = -1; | 109 | nt->lrn = -1; |
| 110 | nt->lwn = -1; | 110 | nt->lwn = -1; |
| @@ -120,7 +120,7 @@ nbiof_free(BIO *a) | |||
| 120 | if (a == NULL) | 120 | if (a == NULL) |
| 121 | return (0); | 121 | return (0); |
| 122 | if (a->ptr != NULL) | 122 | if (a->ptr != NULL) |
| 123 | OPENSSL_free(a->ptr); | 123 | free(a->ptr); |
| 124 | a->ptr = NULL; | 124 | a->ptr = NULL; |
| 125 | a->init = 0; | 125 | a->init = 0; |
| 126 | a->flags = 0; | 126 | a->flags = 0; |
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 90f1b1c1ef..c226d943af 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c | |||
| @@ -68,13 +68,13 @@ BIO | |||
| 68 | { | 68 | { |
| 69 | BIO *ret = NULL; | 69 | BIO *ret = NULL; |
| 70 | 70 | ||
| 71 | ret = (BIO *)OPENSSL_malloc(sizeof(BIO)); | 71 | ret = (BIO *)malloc(sizeof(BIO)); |
| 72 | if (ret == NULL) { | 72 | if (ret == NULL) { |
| 73 | BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); | 73 | BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); |
| 74 | return (NULL); | 74 | return (NULL); |
| 75 | } | 75 | } |
| 76 | if (!BIO_set(ret, method)) { | 76 | if (!BIO_set(ret, method)) { |
| 77 | OPENSSL_free(ret); | 77 | free(ret); |
| 78 | ret = NULL; | 78 | ret = NULL; |
| 79 | } | 79 | } |
| 80 | return (ret); | 80 | return (ret); |
| @@ -136,7 +136,7 @@ BIO_free(BIO *a) | |||
| 136 | if ((a->method == NULL) || (a->method->destroy == NULL)) | 136 | if ((a->method == NULL) || (a->method->destroy == NULL)) |
| 137 | return (1); | 137 | return (1); |
| 138 | a->method->destroy(a); | 138 | a->method->destroy(a); |
| 139 | OPENSSL_free(a); | 139 | free(a); |
| 140 | return (1); | 140 | return (1); |
| 141 | } | 141 | } |
| 142 | 142 | ||
diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c index d7c151eaaa..161b5d01f8 100644 --- a/src/lib/libcrypto/bio/bss_acpt.c +++ b/src/lib/libcrypto/bio/bss_acpt.c | |||
| @@ -137,7 +137,7 @@ static BIO_ACCEPT | |||
| 137 | { | 137 | { |
| 138 | BIO_ACCEPT *ret; | 138 | BIO_ACCEPT *ret; |
| 139 | 139 | ||
| 140 | if ((ret = (BIO_ACCEPT *)OPENSSL_malloc(sizeof(BIO_ACCEPT))) == NULL) | 140 | if ((ret = (BIO_ACCEPT *)malloc(sizeof(BIO_ACCEPT))) == NULL) |
| 141 | return (NULL); | 141 | return (NULL); |
| 142 | 142 | ||
| 143 | memset(ret, 0, sizeof(BIO_ACCEPT)); | 143 | memset(ret, 0, sizeof(BIO_ACCEPT)); |
| @@ -153,12 +153,12 @@ BIO_ACCEPT_free(BIO_ACCEPT *a) | |||
| 153 | return; | 153 | return; |
| 154 | 154 | ||
| 155 | if (a->param_addr != NULL) | 155 | if (a->param_addr != NULL) |
| 156 | OPENSSL_free(a->param_addr); | 156 | free(a->param_addr); |
| 157 | if (a->addr != NULL) | 157 | if (a->addr != NULL) |
| 158 | OPENSSL_free(a->addr); | 158 | free(a->addr); |
| 159 | if (a->bio_chain != NULL) | 159 | if (a->bio_chain != NULL) |
| 160 | BIO_free(a->bio_chain); | 160 | BIO_free(a->bio_chain); |
| 161 | OPENSSL_free(a); | 161 | free(a); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | static void | 164 | static void |
| @@ -357,7 +357,7 @@ acpt_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 357 | if (num == 0) { | 357 | if (num == 0) { |
| 358 | b->init = 1; | 358 | b->init = 1; |
| 359 | if (data->param_addr != NULL) | 359 | if (data->param_addr != NULL) |
| 360 | OPENSSL_free(data->param_addr); | 360 | free(data->param_addr); |
| 361 | data->param_addr = BUF_strdup(ptr); | 361 | data->param_addr = BUF_strdup(ptr); |
| 362 | } else if (num == 1) { | 362 | } else if (num == 1) { |
| 363 | data->accept_nbio = (ptr != NULL); | 363 | data->accept_nbio = (ptr != NULL); |
diff --git a/src/lib/libcrypto/bio/bss_bio.c b/src/lib/libcrypto/bio/bss_bio.c index a74fcfdabc..4d93aba0a4 100644 --- a/src/lib/libcrypto/bio/bss_bio.c +++ b/src/lib/libcrypto/bio/bss_bio.c | |||
| @@ -146,7 +146,7 @@ bio_new(BIO *bio) | |||
| 146 | { | 146 | { |
| 147 | struct bio_bio_st *b; | 147 | struct bio_bio_st *b; |
| 148 | 148 | ||
| 149 | b = OPENSSL_malloc(sizeof *b); | 149 | b = malloc(sizeof *b); |
| 150 | if (b == NULL) | 150 | if (b == NULL) |
| 151 | return 0; | 151 | return 0; |
| 152 | 152 | ||
| @@ -173,10 +173,10 @@ bio_free(BIO *bio) | |||
| 173 | bio_destroy_pair(bio); | 173 | bio_destroy_pair(bio); |
| 174 | 174 | ||
| 175 | if (b->buf != NULL) { | 175 | if (b->buf != NULL) { |
| 176 | OPENSSL_free(b->buf); | 176 | free(b->buf); |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | OPENSSL_free(b); | 179 | free(b); |
| 180 | 180 | ||
| 181 | return 1; | 181 | return 1; |
| 182 | } | 182 | } |
| @@ -516,7 +516,7 @@ bio_ctrl(BIO *bio, int cmd, long num, void *ptr) | |||
| 516 | 516 | ||
| 517 | if (b->size != new_size) { | 517 | if (b->size != new_size) { |
| 518 | if (b->buf) { | 518 | if (b->buf) { |
| 519 | OPENSSL_free(b->buf); | 519 | free(b->buf); |
| 520 | b->buf = NULL; | 520 | b->buf = NULL; |
| 521 | } | 521 | } |
| 522 | b->size = new_size; | 522 | b->size = new_size; |
| @@ -701,7 +701,7 @@ bio_make_pair(BIO *bio1, BIO *bio2) | |||
| 701 | } | 701 | } |
| 702 | 702 | ||
| 703 | if (b1->buf == NULL) { | 703 | if (b1->buf == NULL) { |
| 704 | b1->buf = OPENSSL_malloc(b1->size); | 704 | b1->buf = malloc(b1->size); |
| 705 | if (b1->buf == NULL) { | 705 | if (b1->buf == NULL) { |
| 706 | BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE); | 706 | BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE); |
| 707 | return 0; | 707 | return 0; |
| @@ -711,7 +711,7 @@ bio_make_pair(BIO *bio1, BIO *bio2) | |||
| 711 | } | 711 | } |
| 712 | 712 | ||
| 713 | if (b2->buf == NULL) { | 713 | if (b2->buf == NULL) { |
| 714 | b2->buf = OPENSSL_malloc(b2->size); | 714 | b2->buf = malloc(b2->size); |
| 715 | if (b2->buf == NULL) { | 715 | if (b2->buf == NULL) { |
| 716 | BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE); | 716 | BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE); |
| 717 | return 0; | 717 | return 0; |
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c index db877b140b..78ce240648 100644 --- a/src/lib/libcrypto/bio/bss_conn.c +++ b/src/lib/libcrypto/bio/bss_conn.c | |||
| @@ -147,7 +147,7 @@ conn_state(BIO *b, BIO_CONNECT *c) | |||
| 147 | break; | 147 | break; |
| 148 | } | 148 | } |
| 149 | if (c->param_port != NULL) | 149 | if (c->param_port != NULL) |
| 150 | OPENSSL_free(c->param_port); | 150 | free(c->param_port); |
| 151 | c->param_port = BUF_strdup(p); | 151 | c->param_port = BUF_strdup(p); |
| 152 | } | 152 | } |
| 153 | } | 153 | } |
| @@ -293,7 +293,7 @@ BIO_CONNECT | |||
| 293 | { | 293 | { |
| 294 | BIO_CONNECT *ret; | 294 | BIO_CONNECT *ret; |
| 295 | 295 | ||
| 296 | if ((ret = (BIO_CONNECT *)OPENSSL_malloc(sizeof(BIO_CONNECT))) == NULL) | 296 | if ((ret = (BIO_CONNECT *)malloc(sizeof(BIO_CONNECT))) == NULL) |
| 297 | return (NULL); | 297 | return (NULL); |
| 298 | ret->state = BIO_CONN_S_BEFORE; | 298 | ret->state = BIO_CONN_S_BEFORE; |
| 299 | ret->param_hostname = NULL; | 299 | ret->param_hostname = NULL; |
| @@ -316,10 +316,10 @@ BIO_CONNECT_free(BIO_CONNECT *a) | |||
| 316 | return; | 316 | return; |
| 317 | 317 | ||
| 318 | if (a->param_hostname != NULL) | 318 | if (a->param_hostname != NULL) |
| 319 | OPENSSL_free(a->param_hostname); | 319 | free(a->param_hostname); |
| 320 | if (a->param_port != NULL) | 320 | if (a->param_port != NULL) |
| 321 | OPENSSL_free(a->param_port); | 321 | free(a->param_port); |
| 322 | OPENSSL_free(a); | 322 | free(a); |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | BIO_METHOD | 325 | BIO_METHOD |
| @@ -470,11 +470,11 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 470 | b->init = 1; | 470 | b->init = 1; |
| 471 | if (num == 0) { | 471 | if (num == 0) { |
| 472 | if (data->param_hostname != NULL) | 472 | if (data->param_hostname != NULL) |
| 473 | OPENSSL_free(data->param_hostname); | 473 | free(data->param_hostname); |
| 474 | data->param_hostname = BUF_strdup(ptr); | 474 | data->param_hostname = BUF_strdup(ptr); |
| 475 | } else if (num == 1) { | 475 | } else if (num == 1) { |
| 476 | if (data->param_port != NULL) | 476 | if (data->param_port != NULL) |
| 477 | OPENSSL_free(data->param_port); | 477 | free(data->param_port); |
| 478 | data->param_port = BUF_strdup(ptr); | 478 | data->param_port = BUF_strdup(ptr); |
| 479 | } else if (num == 2) { | 479 | } else if (num == 2) { |
| 480 | char buf[16]; | 480 | char buf[16]; |
| @@ -483,7 +483,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 483 | (void) snprintf(buf, sizeof buf, "%d.%d.%d.%d", | 483 | (void) snprintf(buf, sizeof buf, "%d.%d.%d.%d", |
| 484 | p[0], p[1], p[2], p[3]); | 484 | p[0], p[1], p[2], p[3]); |
| 485 | if (data->param_hostname != NULL) | 485 | if (data->param_hostname != NULL) |
| 486 | OPENSSL_free(data->param_hostname); | 486 | free(data->param_hostname); |
| 487 | data->param_hostname = BUF_strdup(buf); | 487 | data->param_hostname = BUF_strdup(buf); |
| 488 | memcpy(&(data->ip[0]), ptr, 4); | 488 | memcpy(&(data->ip[0]), ptr, 4); |
| 489 | } else if (num == 3) { | 489 | } else if (num == 3) { |
| @@ -492,7 +492,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 492 | (void) snprintf(buf, sizeof buf, "%d", | 492 | (void) snprintf(buf, sizeof buf, "%d", |
| 493 | *(int *)ptr); | 493 | *(int *)ptr); |
| 494 | if (data->param_port != NULL) | 494 | if (data->param_port != NULL) |
| 495 | OPENSSL_free(data->param_port); | 495 | free(data->param_port); |
| 496 | data->param_port = BUF_strdup(buf); | 496 | data->param_port = BUF_strdup(buf); |
| 497 | data->port= *(int *)ptr; | 497 | data->port= *(int *)ptr; |
| 498 | } | 498 | } |
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c index 478c765399..e0445fc97e 100644 --- a/src/lib/libcrypto/bio/bss_dgram.c +++ b/src/lib/libcrypto/bio/bss_dgram.c | |||
| @@ -212,7 +212,7 @@ dgram_new(BIO *bi) | |||
| 212 | 212 | ||
| 213 | bi->init = 0; | 213 | bi->init = 0; |
| 214 | bi->num = 0; | 214 | bi->num = 0; |
| 215 | data = OPENSSL_malloc(sizeof(bio_dgram_data)); | 215 | data = malloc(sizeof(bio_dgram_data)); |
| 216 | if (data == NULL) | 216 | if (data == NULL) |
| 217 | return 0; | 217 | return 0; |
| 218 | memset(data, 0x00, sizeof(bio_dgram_data)); | 218 | memset(data, 0x00, sizeof(bio_dgram_data)); |
| @@ -234,7 +234,7 @@ dgram_free(BIO *a) | |||
| 234 | 234 | ||
| 235 | data = (bio_dgram_data *)a->ptr; | 235 | data = (bio_dgram_data *)a->ptr; |
| 236 | if (data != NULL) | 236 | if (data != NULL) |
| 237 | OPENSSL_free(data); | 237 | free(data); |
| 238 | 238 | ||
| 239 | return (1); | 239 | return (1); |
| 240 | } | 240 | } |
| @@ -805,7 +805,7 @@ BIO | |||
| 805 | * SCTP-AUTH has to be activated for the listening socket | 805 | * SCTP-AUTH has to be activated for the listening socket |
| 806 | * already, otherwise the connected socket won't use it. */ | 806 | * already, otherwise the connected socket won't use it. */ |
| 807 | sockopt_len = (socklen_t)(sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t)); | 807 | sockopt_len = (socklen_t)(sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t)); |
| 808 | authchunks = OPENSSL_malloc(sockopt_len); | 808 | authchunks = malloc(sockopt_len); |
| 809 | memset(authchunks, 0, sizeof(sockopt_len)); | 809 | memset(authchunks, 0, sizeof(sockopt_len)); |
| 810 | ret = getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks, &sockopt_len); | 810 | ret = getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks, &sockopt_len); |
| 811 | OPENSSL_assert(ret >= 0); | 811 | OPENSSL_assert(ret >= 0); |
| @@ -819,7 +819,7 @@ BIO | |||
| 819 | auth_forward = 1; | 819 | auth_forward = 1; |
| 820 | } | 820 | } |
| 821 | 821 | ||
| 822 | OPENSSL_free(authchunks); | 822 | free(authchunks); |
| 823 | 823 | ||
| 824 | OPENSSL_assert(auth_data); | 824 | OPENSSL_assert(auth_data); |
| 825 | OPENSSL_assert(auth_forward); | 825 | OPENSSL_assert(auth_forward); |
| @@ -866,7 +866,7 @@ dgram_sctp_new(BIO *bi) | |||
| 866 | 866 | ||
| 867 | bi->init = 0; | 867 | bi->init = 0; |
| 868 | bi->num = 0; | 868 | bi->num = 0; |
| 869 | data = OPENSSL_malloc(sizeof(bio_dgram_sctp_data)); | 869 | data = malloc(sizeof(bio_dgram_sctp_data)); |
| 870 | if (data == NULL) | 870 | if (data == NULL) |
| 871 | return 0; | 871 | return 0; |
| 872 | memset(data, 0x00, sizeof(bio_dgram_sctp_data)); | 872 | memset(data, 0x00, sizeof(bio_dgram_sctp_data)); |
| @@ -891,7 +891,7 @@ dgram_sctp_free(BIO *a) | |||
| 891 | 891 | ||
| 892 | data = (bio_dgram_sctp_data *)a->ptr; | 892 | data = (bio_dgram_sctp_data *)a->ptr; |
| 893 | if (data != NULL) | 893 | if (data != NULL) |
| 894 | OPENSSL_free(data); | 894 | free(data); |
| 895 | 895 | ||
| 896 | return (1); | 896 | return (1); |
| 897 | } | 897 | } |
| @@ -998,7 +998,7 @@ dgram_sctp_read(BIO *b, char *out, int outl) | |||
| 998 | if (data->saved_message.length > 0) { | 998 | if (data->saved_message.length > 0) { |
| 999 | dgram_sctp_write(data->saved_message.bio, data->saved_message.data, | 999 | dgram_sctp_write(data->saved_message.bio, data->saved_message.data, |
| 1000 | data->saved_message.length); | 1000 | data->saved_message.length); |
| 1001 | OPENSSL_free(data->saved_message.data); | 1001 | free(data->saved_message.data); |
| 1002 | data->saved_message.length = 0; | 1002 | data->saved_message.length = 0; |
| 1003 | } | 1003 | } |
| 1004 | 1004 | ||
| @@ -1087,7 +1087,7 @@ dgram_sctp_read(BIO *b, char *out, int outl) | |||
| 1087 | struct sctp_authchunks *authchunks; | 1087 | struct sctp_authchunks *authchunks; |
| 1088 | 1088 | ||
| 1089 | optlen = (socklen_t)(sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t)); | 1089 | optlen = (socklen_t)(sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t)); |
| 1090 | authchunks = OPENSSL_malloc(optlen); | 1090 | authchunks = malloc(optlen); |
| 1091 | memset(authchunks, 0, sizeof(optlen)); | 1091 | memset(authchunks, 0, sizeof(optlen)); |
| 1092 | ii = getsockopt(b->num, IPPROTO_SCTP, SCTP_PEER_AUTH_CHUNKS, authchunks, &optlen); | 1092 | ii = getsockopt(b->num, IPPROTO_SCTP, SCTP_PEER_AUTH_CHUNKS, authchunks, &optlen); |
| 1093 | OPENSSL_assert(ii >= 0); | 1093 | OPENSSL_assert(ii >= 0); |
| @@ -1101,7 +1101,7 @@ dgram_sctp_read(BIO *b, char *out, int outl) | |||
| 1101 | auth_forward = 1; | 1101 | auth_forward = 1; |
| 1102 | } | 1102 | } |
| 1103 | 1103 | ||
| 1104 | OPENSSL_free(authchunks); | 1104 | free(authchunks); |
| 1105 | 1105 | ||
| 1106 | if (!auth_data || !auth_forward) { | 1106 | if (!auth_data || !auth_forward) { |
| 1107 | BIOerr(BIO_F_DGRAM_SCTP_READ, BIO_R_CONNECT_ERROR); | 1107 | BIOerr(BIO_F_DGRAM_SCTP_READ, BIO_R_CONNECT_ERROR); |
| @@ -1154,7 +1154,7 @@ dgram_sctp_write(BIO *b, const char *in, int inl) | |||
| 1154 | if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) { | 1154 | if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) { |
| 1155 | data->saved_message.bio = b; | 1155 | data->saved_message.bio = b; |
| 1156 | data->saved_message.length = inl; | 1156 | data->saved_message.length = inl; |
| 1157 | data->saved_message.data = OPENSSL_malloc(inl); | 1157 | data->saved_message.data = malloc(inl); |
| 1158 | memcpy(data->saved_message.data, in, inl); | 1158 | memcpy(data->saved_message.data, in, inl); |
| 1159 | return inl; | 1159 | return inl; |
| 1160 | } | 1160 | } |
| @@ -1282,7 +1282,7 @@ dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 1282 | 1282 | ||
| 1283 | /* Add new key */ | 1283 | /* Add new key */ |
| 1284 | sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); | 1284 | sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); |
| 1285 | authkey = OPENSSL_malloc(sockopt_len); | 1285 | authkey = malloc(sockopt_len); |
| 1286 | memset(authkey, 0x00, sockopt_len); | 1286 | memset(authkey, 0x00, sockopt_len); |
| 1287 | authkey->sca_keynumber = authkeyid.scact_keynumber + 1; | 1287 | authkey->sca_keynumber = authkeyid.scact_keynumber + 1; |
| 1288 | #ifndef __FreeBSD__ | 1288 | #ifndef __FreeBSD__ |
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c index 2d38837f9e..cde3c858f1 100644 --- a/src/lib/libcrypto/bio/bss_log.c +++ b/src/lib/libcrypto/bio/bss_log.c | |||
| @@ -157,7 +157,7 @@ slg_write(BIO *b, const char *in, int inl) | |||
| 157 | { 0, "", LOG_ERR } /* The default */ | 157 | { 0, "", LOG_ERR } /* The default */ |
| 158 | }; | 158 | }; |
| 159 | 159 | ||
| 160 | if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) { | 160 | if ((buf = (char *)malloc(inl + 1)) == NULL) { |
| 161 | return (0); | 161 | return (0); |
| 162 | } | 162 | } |
| 163 | strlcpy(buf, in, inl + 1); | 163 | strlcpy(buf, in, inl + 1); |
| @@ -169,7 +169,7 @@ slg_write(BIO *b, const char *in, int inl) | |||
| 169 | 169 | ||
| 170 | xsyslog(b, priority, pp); | 170 | xsyslog(b, priority, pp); |
| 171 | 171 | ||
| 172 | OPENSSL_free(buf); | 172 | free(buf); |
| 173 | return (ret); | 173 | return (ret); |
| 174 | } | 174 | } |
| 175 | 175 | ||
