android icon indicating copy to clipboard operation
android copied to clipboard

[TECHNICAL] Resource leak in `CopyAndUploadContentUrisTask.java`

Open dataCenter430 opened this issue 8 months ago • 2 comments

File: owncloudApp/src/main/java/com/owncloud/android/ui/asynctasks/CopyAndUploadContentUrisTask.java In the loop over URIs (lines 147–182), inputStream and outputStream are reassigned every iteration but never closed inside the loop. Only the last iteration’s streams are closed in finally. All previous streams are leaked. Fix: Close each stream after use in the loop (e.g. in a finally block per iteration, or use try-with-resources), then set to null before the next iteration.

dataCenter430 avatar Mar 05 '26 18:03 dataCenter430

Please assign it to me, if needed

dataCenter430 avatar Mar 05 '26 18:03 dataCenter430

Please submit a pull request right away. Thank you!

DeepDiver1975 avatar Mar 05 '26 21:03 DeepDiver1975