[jira] [Commented] (XERCESC-2214) Wrong delete[] in MemBufInputSource dtor

"Scott Cantor (Jira)" <[email protected]>
Newsgroups gmane.text.xml.xerces-c.devel
Message-ID <[email protected]>
    [ https://issues.apache.org/jira/browse/XERCESC-2214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613216#comment-17613216 ] 

Scott Cantor commented on XERCESC-2214:
---------------------------------------

Actually I think it's underdocumented, not so much wrong.

My review suggests that nothing is calling this with the adopt flag set to true, so in fact nothing is running that code. But I suspect the underlying thought was that if it were somebody doing that, it's a memory buffer and would be allocated as an array. Of course that's an arbitrary assumption given no flag to signal that.

I'm inclined to add a note to the API documentation comments about it and leave the code as is.

> Wrong delete[] in MemBufInputSource dtor
> ----------------------------------------
>
>                 Key: XERCESC-2214
>                 URL: https://issues.apache.org/jira/browse/XERCESC-2214
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Miscellaneous
>    Affects Versions: 3.2.3
>            Reporter: Tobias Elbrandt
>            Assignee: Scott Cantor
>            Priority: Minor
>             Fix For: 3.2.4
>
>
> Our address sanatizer found a mismatching delete[] for memory allocated via {{new}} (not {{new[]}}) in the destructor of {color:#000000}MemBufInputSource{color}.
> I looked at the code to find places where {{new[]}} is used which would make it necessary to use {{delete[]}} instead of {{delete}} - without success. It seems to me that using {{delete[]}} is simply wrong here.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.