Hi,
>From the code:
http://cvs.openssl.org/fileview?f=openssl/crypto/ecdsa/ecdsatest.c&v=1.35
I think the "if (tmp)" check from the fbytes method could be
eliminated since it contains a quite redundant checking.
"tmp" is allready dereferenced previously inside those 2 functions:
if (num != BN_num_bytes(tmp) || !BN_bn2bin(tmp, buf))
Speaking of which, the free method checks the variable, argument
against NULL, anyway...
void BN_free(BIGNUM *a)
{
if (a == NULL) return;
...
Please englighten me if I am mistaken about it and thank you in advance ! :-)
Best Regards,
Laszlo Papp
--- ../tmp/openssl-SNAP-20110407/crypto/ecdsa/ecdsatest.c 2011-04-07
03:00:07.000000000 +0300
+++ crypto/ecdsa/ecdsatest.c 2011-04-08 10:57:11.876666784 +0300
@@ -177,8 +177,7 @@
ret = 0;
else
ret = 1;
- if (tmp)
- BN_free(tmp);
+ BN_free(tmp);
return ret;
}