X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Fbio_asn1.c;fp=crypto%2Fasn1%2Fbio_asn1.c;h=b88b2e59ee47cf5533829d5c8829ba17c1eee453;hp=3c7c12291bb48960be41abdf65ac3e04a2940908;hb=cdb10bae3f773401e039c55965eb177a6f3fc160;hpb=29f484d00d732ea4c19a7fd3dc0440045653e79e diff --git a/crypto/asn1/bio_asn1.c b/crypto/asn1/bio_asn1.c index 3c7c12291b..b88b2e59ee 100644 --- a/crypto/asn1/bio_asn1.c +++ b/crypto/asn1/bio_asn1.c @@ -116,9 +116,10 @@ static int asn1_bio_new(BIO *b) static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size) { - ctx->buf = OPENSSL_malloc(size); - if (ctx->buf == NULL) + if ((ctx->buf = OPENSSL_malloc(size)) == NULL) { + ASN1err(ASN1_F_ASN1_BIO_INIT, ERR_R_MALLOC_FAILURE); return 0; + } ctx->bufsize = size; ctx->asn1_class = V_ASN1_UNIVERSAL; ctx->asn1_tag = V_ASN1_OCTET_STRING;