mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
InspectingOutputStream extends OutputStream but does not override close(). When content exceeds MEMORY_LIMIT (approximately 4 KB), convertToTempFile() replaces the ByteArrayOutputStream delegate with a FileOutputStream. The try-with-resources in InspectedContent.of() calls close(), which inherits the no-op OutputStream.close(), leaving the FileOutputStream open and leaking a file descriptor. Override close() to delegate to the underlying stream. See gh-50639 Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>