diff options
Diffstat (limited to 'crypto/ec/ec_print.c')
-rw-r--r-- | crypto/ec/ec_print.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/ec/ec_print.c b/crypto/ec/ec_print.c index 1afa2ce875..3cd6b6befb 100644 --- a/crypto/ec/ec_print.c +++ b/crypto/ec/ec_print.c @@ -8,6 +8,7 @@ */ #include <openssl/crypto.h> +#include <openssl/err.h> #include "ec_lcl.h" BIGNUM *EC_POINT_point2bn(const EC_GROUP *group, @@ -39,9 +40,10 @@ EC_POINT *EC_POINT_bn2point(const EC_GROUP *group, if ((buf_len = BN_num_bytes(bn)) == 0) return NULL; - buf = OPENSSL_malloc(buf_len); - if (buf == NULL) + if ((buf = OPENSSL_malloc(buf_len)) == NULL) { + ECerr(EC_F_EC_POINT_BN2POINT, ERR_R_MALLOC_FAILURE); return NULL; + } if (!BN_bn2bin(bn, buf)) { OPENSSL_free(buf); |