diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-04-12 13:02:56 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-04-12 13:02:56 +0000 |
commit | e2abfd58cce279d6c986f0fee2b827e7ec243a81 (patch) | |
tree | 8d665bc296f44c43cd63c52f41bfc057acf561e6 /fips | |
parent | 364ce53cef64bc00176f864db444a086fc4f6e4f (diff) |
Stop warning and fix memory leaks.
Diffstat (limited to 'fips')
-rw-r--r-- | fips/ecdsa/fips_ecdsa_selftest.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fips/ecdsa/fips_ecdsa_selftest.c b/fips/ecdsa/fips_ecdsa_selftest.c index c456b75099..722ae673bc 100644 --- a/fips/ecdsa/fips_ecdsa_selftest.c +++ b/fips/ecdsa/fips_ecdsa_selftest.c @@ -97,7 +97,8 @@ int FIPS_selftest_ecdsa() BIGNUM *x = NULL, *y = NULL, *d = NULL; EVP_MD_CTX mctx; ECDSA_SIG *esig = NULL; - int i, rv = 0; + int rv = 0; + size_t i; FIPS_md_ctx_init(&mctx); @@ -105,9 +106,9 @@ int FIPS_selftest_ecdsa() { EC_SELFTEST_PRIVKEY *key = test_ec_keys + i; - x = BN_bin2bn(key->x, key->xlen, NULL); - y = BN_bin2bn(key->y, key->ylen, NULL); - d = BN_bin2bn(key->d, key->dlen, NULL); + x = BN_bin2bn(key->x, key->xlen, x); + y = BN_bin2bn(key->y, key->ylen, y); + d = BN_bin2bn(key->d, key->dlen, d); if (!x || !y || !d) goto err; @@ -142,12 +143,14 @@ int FIPS_selftest_ecdsa() FIPS_ecdsa_sig_free(esig); esig = NULL; + EC_KEY_free(ec); + ec = NULL; } rv = 1; err: - + if (x) BN_clear_free(x); if (y) |