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 new C++ version #40

Closed
GoogleCodeExporter opened this issue Mar 13, 2016 · 2 comments
Closed

Memory leak in new C++ version #40

GoogleCodeExporter opened this issue Mar 13, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

I haven't tried the new version yet, but this looks, to me, like it leaks:

380:  int *v1 = new int[v_length];
381:  int *v2 = new int[v_length];

<http://code.google.com/p/google-diff-match-patch/source/browse/trunk/cpp/diff_m
atch_patch.cpp?spec=svn85&r=85#380>

I don't see any `delete [] v1;` or `delete [] v2;`.
After all this is only C++ ... no garbage collectors here ;-).

Original issue reported on code.google.com by chris...@gmail.com on 22 Jan 2011 at 8:50

@GoogleCodeExporter
Copy link
Author

Good catch.  Thanks.  A pair of deletes need to be added at all three exit 
points in that function.  I've checked the rest of the codebase and this bug 
appears to be unique.

The change has been sent for code review and will likely be pushed on Monday.

Original comment by neil.fra...@gmail.com on 22 Jan 2011 at 10:08

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Fixed and uploaded to both Subversion and the downloadable package.

Thanks for catching this!

Original comment by neil.fra...@gmail.com on 24 Jan 2011 at 9:16

  • Changed state: Fixed

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

1 participant