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 leaks when Channel() constructor throws #7

Closed
stonemaster opened this issue May 22, 2012 · 3 comments
Closed

Memory leaks when Channel() constructor throws #7

stonemaster opened this issue May 22, 2012 · 3 comments

Comments

@stonemaster
Copy link
Contributor

There are memory leaks when the constructor Channel throws an exception:

  • The m_impl->m_connection won't be reset because the object has not been successfully created. So ~Channel() won't ever be called. Maybe m_connection should be wrapped in a thin wrapper which just handles freeing the connetion.
  • If an error occurs and amp_error_string is called, the memory which is reserved within that function never gets freed.
@alanxz
Copy link
Owner

alanxz commented May 22, 2012

These look like a valid bug. Thanks for reporting!

alanxz added a commit that referenced this issue May 22, 2012
Fixes for Issue #7: Memory leaks in Channe() when it throws
@alanxz
Copy link
Owner

alanxz commented May 22, 2012

Should now be fixed.

@alanxz alanxz closed this as completed May 22, 2012
@stonemaster
Copy link
Contributor Author

Thanks for the patch! Works like a charm.

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

No branches or pull requests

2 participants