Skip to content

[TECHNICAL] Resource leak in CopyAndUploadContentUrisTask.java #4797

@dataCenter430

Description

@dataCenter430

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions