[
https://issues.apache.org/jira/browse/XERCESC-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Scott Cantor updated XERCESC-2168:
----------------------------------
Fix Version/s: 3.2.3
> Memory leak in ValueVectorOf
> ----------------------------
>
> Key: XERCESC-2168
> URL: https://issues.apache.org/jira/browse/XERCESC-2168
> Project: Xerces-C++
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 3.2.2
> Reporter: Laurent Pelecq
> Priority: Major
> Fix For: 3.2.3
>
> Attachments: memory_leaks_no_realloc.txt, memory_leaks_realloc.txt,
> xerces_leak.cpp, xerces_operator_leak.patch
>
>
> ValueVectorOf has been changed to call the object destructors for example in
> ~ValueOfVector:
> {{{color:#205081}template <class TElem>
> ValueVectorOf<TElem>::~ValueVectorOf(){color}}}
> {{{color:#205081}{{color}}}
> {{ {color:#8eb021}if (fCallDestructor) {{color}}}
> {{{color:#8eb021} for (XMLSize_t index=fMaxCount; index > 0;
> index--){color}}}
> {{{color:#8eb021} fElemList[index-1].~TElem();{color}}}
> {{{color:#8eb021} }{color}}}
> {{{color:#205081} fMemoryManager->deallo[link
> title|http://example.com]cate(fElemList); //delete [] fElemList;{color}}}
> {{{color:#205081}}{color}}}
> But the code is missing in ValueVectorOf<TElem>::operator=.
> A sample code is attached with the corresponding valgrind reports. The sample
> covers the case where the buffer shrinks (no realloc) or grows (pass realloc
> as argument to the command).
> The attached patch fixes the leak.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]