Mismatching new[]/delete in DL_Extrusion

Please use this forum to post feedback and suggestions related to dxflib.

Moderator: andrew

Post Reply
VZ
Registered Member
Posts: 1
Joined: Tue Mar 16, 2010 4:15 pm

Mismatching new[]/delete in DL_Extrusion

Post by VZ » Tue Mar 16, 2010 4:19 pm

Hello,

There is a bug in DL_Extrusion class: its ctor allocates "direction" variable using new[] but its dtor deletes it instead of using the correct delete[]. Output courtesy of valgrind:

Code: Select all

==15986== Mismatched free() / delete / delete []
==15986==    at 0x4C20E0D: operator delete(void*) (vg_replace_malloc.c:342)
==15986==    by 0x4DB9E7: DL_Extrusion::~DL_Extrusion() (dl_extrusion.h:57)
==15986==    by 0x4DBB40: DL_CreationInterface::~DL_CreationInterface() (dl_creationinterface.h:53)
==15986==    by 0x4DBBF3: DL_CreationAdapter::~DL_CreationAdapter() (dl_creationadapter.h:42)
... my own code follows ...
==15986==  Address 0x10d56e20 is 0 bytes inside a block of size 24 alloc'd
==15986==    at 0x4C2188C: operator new[](unsigned long) (vg_replace_malloc.c:274)
==15986==    by 0x4DD9EB: DL_Extrusion::DL_Extrusion() (dl_extrusion.h:47)
==15986==    by 0x4DDA5B: DL_CreationInterface::DL_CreationInterface() (dl_creationinterface.h:50)
==15986==    by 0x4DDAD8: DL_CreationAdapter::DL_CreationAdapter() (dl_creationadapter.h:41)
... my own code follows ...
I hope this report is useful and this bug could be fixed in the next version.

Thanks!
VZ

Post Reply

Return to “dxflib Suggestions and Feedback”