-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Affects Version/s: 2.3.2
-
Component/s: Core - Content REST APIs
AttachmentsSoapService doesn't close inputStream in getAttachmentData(long, String, int).
(AttachmentsSoapService:108)
FileUtils.copy(attachmentManager.getAttachmentData(attachment),baos);
baos.close();
There is no use in closing baos, but input stream must be closed, as it could be a file stream, for example.
Should be something like this, I presume:
InputStream inputStream = attachmentManager.getAttachmentData(attachment);
FileUtils.copy(inputStream,baos);
inputStream.close();