Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in XrdCl::Utils::GetHostAddresses() #1265

Closed
abh3 opened this issue Jul 30, 2020 · 1 comment
Closed

Memory leak in XrdCl::Utils::GetHostAddresses() #1265

abh3 opened this issue Jul 30, 2020 · 1 comment
Assignees

Comments

@abh3
Copy link
Member

abh3 commented Jul 30, 2020

a) Utils::GetHostAddresses.cc:153 calls XrdNetUtils::GetAddrs(0 which returns XrdNetAddr*[] essentially a vector of pointers to XrdNetAddr objects.
b) Utils::GetHostAddresses.cc:194 copies objects of interest to std::vector result
c) In Utils::GetHostAddresses.cc:207 the vector returned by (a) is deleted. Unfortunately, only the pointer collection is deleted but the underlying objects it points to remain.
Hence we have a memory leak here. Utils::GetHostAddresses.cc needs to delete each individual object before deleting the vector which it does not. Fortunately, this memory leak is very slow so I am not tagging it as critical.

@abh3
Copy link
Member Author

abh3 commented Jul 31, 2020

Misread the code, sigh. Not really a problem.

@abh3 abh3 closed this as completed Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants