Possible Memory Leak In Drawable.cpp
Posted: 2010-08-05T06:23:07-07:00
Hi everybody,
while checking a a program of mine with Valgrind, I noticed a small memory leak which (to me) seems to lead into the Magick++ code.
In Drawable.h, at line 1045, there is a call to:
This may not free the memory correctly, I think it should be:
I could't see a place to attach diffs so I will just post it here (as its really rather small)
Could this be the fix?
Best Regards
Danny
while checking a a program of mine with Valgrind, I noticed a small memory leak which (to me) seems to lead into the Magick++ code.
In Drawable.h, at line 1045, there is a call to:
Code: Select all
delete _dasharray;
Code: Select all
delete[] _dasharray;
Code: Select all
Index: Magick++/lib/Drawable.cpp
===================================================================
--- Magick++/lib/Drawable.cpp (revision 2378)
+++ Magick++/lib/Drawable.cpp (working copy)
@@ -1042,7 +1042,7 @@
}
Magick::DrawableDashArray::~DrawableDashArray( void )
{
- delete _dasharray;
+ delete[] _dasharray;
_size = 0;
_dasharray = 0;
}
Best Regards
Danny