Skip to content

Commit 7c73801

Browse files
committed
test_eid: Clean up after test case
Free all allocated memory to avoid false-positive leak reports. Resolves: ==10460==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 552 byte(s) in 1 object(s) allocated from: #0 0x7f3e1a574ae8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8) #1 0x7f3e1a433cf0 in __mctp_alloc /home/andrew/src/openbmc/libmctp/alloc.c:28 #2 0x7f3e1a42eedc in mctp_init /home/andrew/src/openbmc/libmctp/core.c:234 #3 0x55f705f81268 in mctp_test_stack_init tests/test-utils.c:63 #4 0x55f705f7edff in main tests/test_eid.c:51 #5 0x7f3e198df1e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2) Indirect leak of 56 byte(s) in 1 object(s) allocated from: #0 0x7f3e1a574ae8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8) #1 0x7f3e1a433cf0 in __mctp_alloc /home/andrew/src/openbmc/libmctp/alloc.c:28 #2 0x55f705f80c99 in mctp_binding_test_init tests/test-utils.c:27 #3 0x55f705f812e1 in mctp_test_stack_init tests/test-utils.c:66 #4 0x55f705f7edff in main tests/test_eid.c:51 #5 0x7f3e198df1e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2) Indirect leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f3e1a574ae8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8) #1 0x7f3e1a433cf0 in __mctp_alloc /home/andrew/src/openbmc/libmctp/alloc.c:28 #2 0x7f3e1a42f55f in mctp_register_bus /home/andrew/src/openbmc/libmctp/core.c:277 #3 0x55f705f8121b in mctp_binding_test_register_bus tests/test-utils.c:56 #4 0x55f705f81405 in mctp_test_stack_init tests/test-utils.c:69 #5 0x55f705f7edff in main tests/test_eid.c:51 #6 0x7f3e198df1e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2) Signed-off-by: Andrew Jeffery <[email protected]> Change-Id: I34eae31219d4a31e8388d180be746ae8b7ec5c04
1 parent c68d96e commit 7c73801

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_eid.c

+3
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,8 @@ int main(void)
7171

7272
assert(ctx->rx_count == 0);
7373

74+
mctp_binding_test_destroy(ctx->binding);
75+
mctp_destroy(ctx->mctp);
76+
7477
return EXIT_SUCCESS;
7578
}

0 commit comments

Comments
 (0)