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

Fix potential memory leak in TcpClient::send #2753

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Apr 1, 2024

This PR addresses a concern raised by Coverity. The TcpClient::send(const char*, ... method is tricky because it can either use the existing stream or create a new one. Further leaks are possible in TcpClient::send(IDataSourceStream*, ... when inspecting the failure paths. The code has been refactored using std::unique_ptr guards.

@mikee47 mikee47 changed the title Fix potential memory leak in TcpClient::send [WIP] Fix potential memory leak in TcpClient::send Apr 1, 2024
@SmingHub SmingHub deleted a comment from what-the-diff bot Apr 1, 2024
@mikee47 mikee47 changed the title [WIP] Fix potential memory leak in TcpClient::send Fix potential memory leak in TcpClient::send Apr 3, 2024
@mikee47 mikee47 requested a review from slaff April 3, 2024 09:47
@slaff slaff added this to the 5.2.0 milestone Apr 3, 2024
@slaff slaff merged commit 1bcb31d into SmingHub:develop Apr 8, 2024
45 of 46 checks passed
@mikee47 mikee47 deleted the fix/TcpClient-send-leak branch April 8, 2024 10:20
@slaff slaff mentioned this pull request May 8, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants