summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTim Ruehsen <tim.ruehsen@gmx.de>2012-09-19 23:06:24 +0200
committerNiels Möller <nisse@lysator.liu.se>2012-09-19 23:11:51 +0200
commit15a4d92d077cc3bb656aee078229e0167dfdb1d6 (patch)
treecab1b346c026cc3530e18980f97ba642c1b901cf /examples
parentdc214c3a3ca5630f7966e86759ca64a5b66acd7e (diff)
downloadnettle-15a4d92d077cc3bb656aee078229e0167dfdb1d6.tar.gz
Additional deallocation fixes.
Diffstat (limited to 'examples')
-rw-r--r--examples/rsa-encrypt.c6
-rw-r--r--examples/rsa-keygen.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/examples/rsa-encrypt.c b/examples/rsa-encrypt.c
index 70d1503d..c0caba32 100644
--- a/examples/rsa-encrypt.c
+++ b/examples/rsa-encrypt.c
@@ -253,11 +253,13 @@ main(int argc, char **argv)
}
write_bignum(stdout, x);
-
+
+ mpz_clear (x);
+
if (!process_file(&ctx,
stdin, stdout))
return EXIT_FAILURE;
-
+
rsa_public_key_clear(&key);
return EXIT_SUCCESS;
diff --git a/examples/rsa-keygen.c b/examples/rsa-keygen.c
index 0ca39b4b..eec7fd5a 100644
--- a/examples/rsa-keygen.c
+++ b/examples/rsa-keygen.c
@@ -160,5 +160,11 @@ main(int argc, char **argv)
return EXIT_FAILURE;
}
+ nettle_buffer_clear(&priv_buffer);
+ nettle_buffer_clear(&pub_buffer);
+ rsa_public_key_clear(&pub);
+ rsa_private_key_clear(&priv);
+ free (pub_name);
+
return EXIT_SUCCESS;
}