TOOLS/INFO: fix memory leak in print_ucp_ep_info() #10169
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Fix memory leak in print_ucp_ep_info()
Why?
Backtrace:
Error executing /__w/1/s/install/bin/ucx_info -u a r t s -e:
=================================================================
==45079==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 600 byte(s) in 1 object(s) allocated from:
#0 0x7f408f721ba8 in __interceptor_malloc (/usr/lib64/libasan.so.5+0xefba8)
#1 0x7f408e6e52a7 in ucs_malloc /__w/1/s/contrib/../src/ucs/debug/memtrack.c:320
#2 0x7f408f053e70 in ucp_address_pack /__w/1/s/contrib/../src/ucp/wireup/address.c:1562
#3 0x7f408ee35e8a in ucp_worker_address_pack /__w/1/s/contrib/../src/ucp/core/ucp_worker.c:2972
#4 0x7f408ee360ef in ucp_worker_query /__w/1/s/contrib/../src/ucp/core/ucp_worker.c:2990
#5 0x405988 in print_ucp_ep_info /__w/1/s/contrib/../src/tools/info/proto_info.c:280
#6 0x406146 in print_ucp_info /__w/1/s/contrib/../src/tools/info/proto_info.c:421
#7 0x4038f8 in main /__w/1/s/contrib/../src/tools/info/ucx_info.c:318
#8 0x7f408d8c6492 in __libc_start_main (/usr/lib64/libc.so.6+0x23492)
SUMMARY: AddressSanitizer: 600 byte(s) leaked in 1 allocation(s).
How?
Fix check