[
https://issues.apache.org/jira/browse/FILEUPLOAD-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sebb updated FILEUPLOAD-250:
----------------------------
Affects Version/s: 1.3.1
> FileUploadBase - potential resource leak - InputStream not closed on exception
> ------------------------------------------------------------------------------
>
> Key: FILEUPLOAD-250
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-250
> Project: Commons FileUpload
> Issue Type: Bug
> Affects Versions: 1.3.1
> Reporter: Sebb
> Fix For: 1.4
>
>
> FileUploadBase has several instances where the InputStream "input" is not
> closed when an Exception is throw. This can potentially be a resource leak
> and is best avoided.
> The first case is easy to deal with, as the InputStream does not need to be
> created until after the SizeLimitExceededException has been thrown.
> The next case occurs if the boundary is not found.
> This check could be moved to before the size check, however that would change
> the behaviour slightly, as FileUploadException would be thrown instead of
> SizeLimitExceededException if both boundary and size are wrong.
> The last case is where InvalidContentTypeException is thrown. This cannot
> easily be avoided.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)