[ 
https://issues.apache.org/jira/browse/XERCESC-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13867800#comment-13867800
 ] 

Vemund Handeland commented on XERCESC-2024:
-------------------------------------------

Sorry for the delay.
The fix is OK as long as XMLPlatformUtils::closeFile does not throw. If it 
throws, the code has a memory leak (fDataBuf).

Tested on Windows and verified that it also works in cases where the connection 
to the source is lost (removable drive or network share). Would expect this to 
be the case on other platforms as well, but I should be verified.

> LocalFileFormatTarget leaks file handle
> ---------------------------------------
>
>                 Key: XERCESC-2024
>                 URL: https://issues.apache.org/jira/browse/XERCESC-2024
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Miscellaneous
>            Reporter: Vemund Handeland
>            Assignee: Alberto Massari
>             Fix For: 3.2.0
>
>         Attachments: LocalFileFormatTarget.cpp.patch
>
>
> The call to XMLPlatformUtils::writeBufferToFile in the LocalFileFormatTarget 
> destructor might throw an exception. A typical use case is running out of 
> disk space.
> In this case the file handle will not be closed



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to