diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bf_buff.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bf_buff.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libcrypto/bio/bf_buff.c b/src/lib/libcrypto/bio/bf_buff.c index e96da40a58..0866c8c7a3 100644 --- a/src/lib/libcrypto/bio/bf_buff.c +++ b/src/lib/libcrypto/bio/bf_buff.c | |||
| @@ -130,10 +130,8 @@ buffer_free(BIO *a) | |||
| 130 | if (a == NULL) | 130 | if (a == NULL) |
| 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 | free(b->ibuf); |
| 134 | free(b->ibuf); | 134 | free(b->obuf); |
| 135 | if (b->obuf != NULL) | ||
| 136 | free(b->obuf); | ||
| 137 | free(a->ptr); | 135 | free(a->ptr); |
| 138 | a->ptr = NULL; | 136 | a->ptr = NULL; |
| 139 | a->init = 0; | 137 | a->init = 0; |
| @@ -342,8 +340,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 342 | p1 = malloc((int)num); | 340 | p1 = malloc((int)num); |
| 343 | if (p1 == NULL) | 341 | if (p1 == NULL) |
| 344 | goto malloc_error; | 342 | goto malloc_error; |
| 345 | if (ctx->ibuf != NULL) | 343 | free(ctx->ibuf); |
| 346 | free(ctx->ibuf); | ||
| 347 | ctx->ibuf = p1; | 344 | ctx->ibuf = p1; |
| 348 | } | 345 | } |
| 349 | ctx->ibuf_off = 0; | 346 | ctx->ibuf_off = 0; |
