Skip to content

Commit

Permalink
test: Fix memleak in test-token cleanup
Browse files Browse the repository at this point in the history
GCC's asan spotted this:
  Direct leak of 338 byte(s) in 13 object(s) allocated from:
      #0 0x7f54f03fee20 in malloc (/lib64/libasan.so.3+0xc6e20)
      #1 0x445e8c in p11_path_build ../common/path.c:222
      #2 0x4385bd in expand_tempdir ../common/test.c:334
      #3 0x43869c in p11_test_directory ../common/test.c:361
      #4 0x4033e3 in setup_temp ../trust/test-token.c:79
  • Loading branch information
ueno committed Oct 31, 2016
1 parent ecaf79c commit bc6469c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trust/test-token.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ static void
teardown (void *path)
{
p11_token_free (test.token);
memset (&test, 0, sizeof (test));
}

static void
Expand All @@ -93,6 +92,7 @@ teardown_temp (void *unused)
p11_test_directory_delete (test.directory);
teardown (test.directory);
free (test.directory);
memset (&test, 0, sizeof (test));
}

static void
Expand Down

0 comments on commit bc6469c

Please sign in to comment.