check the return value of BN_new() and BN_dup()
@@ -417,7 +417,7 @@ int test_BN_eq_word(const char *file, int line, const char *bns, const char *ws,
if (a != NULL && BN_is_word(a, w))
return 1;
- bw = BN_new();
+ if ((bw = BN_new()) != NULL)
BN_set_word(bw, w);
test_fail_bignum_message(NULL, file, line, "BIGNUM", bns, ws, "==", a, bw);
BN_free(bw);
@@ -431,9 +431,9 @@ int test_BN_abs_eq_word(const char *file, int line, const char *bns,
if (a != NULL && BN_abs_is_word(a, w))
return 1;
- bw = BN_new();
- aa = BN_dup(a);
+ if ((aa = BN_dup(a)) != NULL)
BN_set_negative(aa, 0);
+ if ((bw = BN_new()) != NULL)
BN_set_word(bw, w);
test_fail_bignum_message(NULL, file, line, "BIGNUM", bns, ws, "abs==",
aa, bw);
