From b219d1890c624d918ba658445b991735f8b804db Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 7 Oct 2012 22:15:20 +0200 Subject: tests: Don't leak memory in options test. --- tests/unittests/torture_options.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/unittests/torture_options.c') diff --git a/tests/unittests/torture_options.c b/tests/unittests/torture_options.c index faa8ac2..76da3ed 100644 --- a/tests/unittests/torture_options.c +++ b/tests/unittests/torture_options.c @@ -44,6 +44,7 @@ static void torture_options_get_host(void **state) { assert_false(ssh_options_get(session, SSH_OPTIONS_HOST, &host)); assert_string_equal(host, "localhost"); + free(host); } static void torture_options_set_port(void **state) { @@ -86,6 +87,7 @@ static void torture_options_get_user(void **state) { assert_true(rc == SSH_OK); rc = ssh_options_get(session, SSH_OPTIONS_USER, &user); assert_string_equal(user, "magicaltrevor"); + free(user); } static void torture_options_set_fd(void **state) { @@ -163,6 +165,7 @@ static void torture_options_get_identity(void **state) { rc = ssh_options_get(session, SSH_OPTIONS_IDENTITY, &identity); assert_true(rc == SSH_OK); assert_string_equal(identity, "identity1"); + SAFE_FREE(identity); rc = ssh_options_set(session, SSH_OPTIONS_IDENTITY, "identity2"); assert_true(rc == 0); @@ -170,6 +173,7 @@ static void torture_options_get_identity(void **state) { rc = ssh_options_get(session, SSH_OPTIONS_IDENTITY, &identity); assert_true(rc == SSH_OK); assert_string_equal(identity, "identity2"); + free(identity); } int torture_run_tests(void) { -- cgit