tests: fix refname leaks

Reported by ASan.

Direct leak of 1468 byte(s) in 48 object(s) allocated from:
    #0 0x7f20d7ae0330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x7f20d76894b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
    #2 0x7f20d7a66827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
    #3 0x7f20d7a66f76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
    #4 0x5598e3fbcdfc in buffer_transform ../../git/weston/tests/buffer-transforms-test.c:122
    #5 0x5598e3fc9add in run_test ../../git/weston/tests/weston-test-runner.c:162
    #6 0x5598e3fca17e in run_case ../../git/weston/tests/weston-test-runner.c:277
    #7 0x5598e3fc9f24 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
    #8 0x5598e3fca406 in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
    #9 0x7f20d3523b6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
    #10 0x7f20d75e8fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
    #11 0x7f20d770a4ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)

Direct leak of 978 byte(s) in 42 object(s) allocated from:
    #0 0x7f26fed07330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x7f26fe8b04b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
    #2 0x7f26fec8d827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
    #3 0x7f26fec8df76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
    #4 0x55989ba8c2bc in output_damage ../../git/weston/tests/output-damage-test.c:201
    #5 0x55989ba8c0cb in wrapoutput_damage ../../git/weston/tests/output-damage-test.c:176
    #6 0x55989ba99131 in run_test ../../git/weston/tests/weston-test-runner.c:162
    #7 0x55989ba997d2 in run_case ../../git/weston/tests/weston-test-runner.c:277
    #8 0x55989ba99578 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
    #9 0x55989ba99a5a in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
    #10 0x7f26fa57ab6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
    #11 0x7f26fe80ffa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
    #12 0x7f26fe9314ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)

Direct leak of 1696 byte(s) in 56 object(s) allocated from:
    #0 0x7f077107f330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x7f0770c284b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
    #2 0x7f0771005827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
    #3 0x7f0771005f76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
    #4 0x563e6ae36dfc in output_transform ../../git/weston/tests/output-transforms-test.c:122
    #5 0x563e6ae43add in run_test ../../git/weston/tests/weston-test-runner.c:162
    #6 0x563e6ae4417e in run_case ../../git/weston/tests/weston-test-runner.c:277
    #7 0x563e6ae43f24 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
    #8 0x563e6ae44406 in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
    #9 0x7f076ca26b6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
    #10 0x7f0770b87fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
    #11 0x7f0770ca94ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 3 years ago committed by Pekka Paalanen
parent 10937feef8
commit b0eb059818
  1. 1
      tests/buffer-transforms-test.c
  2. 1
      tests/output-damage-test.c
  3. 1
      tests/output-transforms-test.c

@ -147,4 +147,5 @@ TEST_P(buffer_transform, my_buffer_args)
assert(match); assert(match);
client_destroy(client); client_destroy(client);
free(refname);
} }

@ -232,4 +232,5 @@ TEST(output_damage)
client->surface->buffer = NULL; client->surface->buffer = NULL;
client_destroy(client); client_destroy(client);
free(refname);
} }

@ -147,4 +147,5 @@ TEST_P(output_transform, my_buffer_args)
assert(match); assert(match);
client_destroy(client); client_destroy(client);
free(refname);
} }

Loading…
Cancel
Save