aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/crypto.c
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-11-15 13:08:28 +0100
committerHans Nilsson <[email protected]>2018-12-03 10:17:36 +0100
commit34d377f0a557478de13b56934389144c338e367b (patch)
tree092d2cf8cf29dcde5a75652631858a069ab5daf4 /lib/crypto/c_src/crypto.c
parentece23c90df4d1844ede7cb524efb4df0fabb3f48 (diff)
downloadotp-34d377f0a557478de13b56934389144c338e367b.tar.gz
otp-34d377f0a557478de13b56934389144c338e367b.tar.bz2
otp-34d377f0a557478de13b56934389144c338e367b.zip
crypto: Fix valgrind errors in privkey_to_pubkey
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r--lib/crypto/c_src/crypto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 3d16c776c0..b77e580391 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -5434,6 +5434,7 @@ static ERL_NIF_TERM privkey_to_pubkey_nif(ErlNifEnv* env, int argc, const ERL_NI
RSA_get0_key(rsa, &n, &e, &d);
result[0] = bin_from_bn(env, e); // Exponent E
result[1] = bin_from_bn(env, n); // Modulus N = p*q
+ RSA_free(rsa);
EVP_PKEY_free(pkey);
return enif_make_list_from_array(env, result, 2);
}
@@ -5448,6 +5449,7 @@ static ERL_NIF_TERM privkey_to_pubkey_nif(ErlNifEnv* env, int argc, const ERL_NI
result[1] = bin_from_bn(env, q);
result[2] = bin_from_bn(env, g);
result[3] = bin_from_bn(env, pub_key);
+ DSA_free(dsa);
EVP_PKEY_free(pkey);
return enif_make_list_from_array(env, result, 4);
}