diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-12-19 12:37:21 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-12-19 12:37:21 +0100 |
commit | 80408d5357956a8a2b438d102aa0953971e136f1 (patch) | |
tree | a72527754dbf1eec5845188be5a1bf85b4041743 | |
parent | 47d11734e1303b1705f9fc23ee93776db2c47d65 (diff) | |
download | libssh-80408d5357956a8a2b438d102aa0953971e136f1.tar.gz libssh-80408d5357956a8a2b438d102aa0953971e136f1.tar.xz libssh-80408d5357956a8a2b438d102aa0953971e136f1.zip |
Fixed memory leak reported by valgrind
-rw-r--r-- | tests/unittests/torture_rand.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unittests/torture_rand.c b/tests/unittests/torture_rand.c index 9962564..847fe40 100644 --- a/tests/unittests/torture_rand.c +++ b/tests/unittests/torture_rand.c @@ -14,11 +14,14 @@ #define NUM_THREADS 100 static void setup(){ - printf("setup\n"); ssh_threads_set_callbacks(ssh_threads_get_pthread()); ssh_init(); } +static void teardown(){ + ssh_finalize(); +} + static void *torture_rand_thread(void *threadid){ char buffer[12]; int i; @@ -52,7 +55,7 @@ END_TEST Suite *torture_make_suite(void) { Suite *s = suite_create("torture_rand"); - torture_create_case_fixture(s, "torture_rand_threading", torture_rand_threading,setup,NULL); + torture_create_case_fixture(s, "torture_rand_threading", torture_rand_threading,setup,teardown); return s; } |