[ https://issues.apache.org/jira/browse/XERCESC-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Scott Cantor updated XERCESC-2050: ---------------------------------- Affects Version/s: 3.1.0 3.1.1 3.1.3 3.1.4 > wrong use of delete keyword in DTest.cpp > ---------------------------------------- > > Key: XERCESC-2050 > URL: https://issues.apache.org/jira/browse/XERCESC-2050 > Project: Xerces-C++ > Issue Type: Bug > Components: Samples/Tests > Affects Versions: 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4 > Reporter: Hanno Böck > Assignee: Alberto Massari > Priority: Minor > Fix For: 3.2.0 > > Attachments: xerces-c-fix-alloc-dealloc.diff > > > In the file DTest.cpp there is a wrong use of the delete keyword. The > variable hugeString is allocated with: > char* hugeString=new char[HUGE_STRING+1]; > It gets deallocated with: > delete hugeString; > When allocating a variable with "new type[size]" one has to deallocate with > "delete [] variable". These kinds of errors can be seen when compiling with > address sanitizer. I'll attach a patch. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org