diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-02-11 14:57:10 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-02-11 14:57:10 -0500 |
commit | 717946089b6008e4744522845014dafa1fc4e37c (patch) | |
tree | 1750ca3984d902f8dc4bbb1f73a705cc174b3128 /src/test/test_crypto.c | |
parent | b9432becbe0ff10788e8f289b6562720822b7ece (diff) | |
download | tor-717946089b6008e4744522845014dafa1fc4e37c.tar.gz tor-717946089b6008e4744522845014dafa1fc4e37c.zip |
Resolve memory leaks in the unit tests and benchmarks (found by coverity)
These shouldn't really matter, but it's nice to be leak-free.
Diffstat (limited to 'src/test/test_crypto.c')
-rw-r--r-- | src/test/test_crypto.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index 33c3d443e6..afb338a69c 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -1082,6 +1082,7 @@ test_crypto_curve25519_persist(void *arg) tt_int_op(0,==,curve25519_keypair_write_to_file(&keypair, fname, "testing")); tt_int_op(0,==,curve25519_keypair_read_from_file(&keypair2, &tag, fname)); tt_str_op(tag,==,"testing"); + tor_free(tag); test_memeq(keypair.pubkey.public_key, keypair2.pubkey.public_key, @@ -1109,6 +1110,7 @@ test_crypto_curve25519_persist(void *arg) fname = tor_strdup(get_fname("bogus_keypair")); tt_int_op(-1, ==, curve25519_keypair_read_from_file(&keypair2, &tag, fname)); + tor_free(tag); content[69] ^= 0xff; tt_int_op(0, ==, write_bytes_to_file(fname, content, st.st_size, 1)); @@ -1117,6 +1119,7 @@ test_crypto_curve25519_persist(void *arg) done: tor_free(fname); tor_free(content); + tor_free(tag); } #endif |