diff options
Diffstat (limited to 'crypto/bio/bf_lbuf.c')
-rw-r--r-- | crypto/bio/bf_lbuf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/bio/bf_lbuf.c b/crypto/bio/bf_lbuf.c index 2dac3d72dd..194c7b8af7 100644 --- a/crypto/bio/bf_lbuf.c +++ b/crypto/bio/bf_lbuf.c @@ -59,11 +59,13 @@ static int linebuffer_new(BIO *bi) { BIO_LINEBUFFER_CTX *ctx; - ctx = OPENSSL_malloc(sizeof(*ctx)); - if (ctx == NULL) + if ((ctx = OPENSSL_malloc(sizeof(*ctx))) == NULL) { + BIOerr(BIO_F_LINEBUFFER_NEW, ERR_R_MALLOC_FAILURE); return 0; + } ctx->obuf = OPENSSL_malloc(DEFAULT_LINEBUFFER_SIZE); if (ctx->obuf == NULL) { + BIOerr(BIO_F_LINEBUFFER_NEW, ERR_R_MALLOC_FAILURE); OPENSSL_free(ctx); return 0; } |