New issue
Advanced search Search tips

Issue 668975 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Nov 2017
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Android: ContentUriUtils.contentUriExists() leaks ParcelFileDescriptor

Reported by comparea...@gmail.com, Nov 28 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce the problem:
https://cs.chromium.org/chromium/src/base/android/java/src/org/chromium/base/ContentUriUtils.java?rcl=0&l=86

public static boolean contentUriExists(Context context, String uriString) {
    return getParcelFileDescriptor(context, uriString) != null;
}

getParcelFileDescriptor() may return a ParcelFileDescriptor object that should be close()'d, if it is returned.

What is the expected behavior?
Something like:

public static boolean contentUriExists(Context context, String uriString) {
    ParcelFileDescriptor pfd = getParcelFileDescriptor(context, uriString);
    if (pfd != null) {
        pfd.close();
        return true;
    }
    return false;
}

What went wrong?
It seems like a leak for close() to not be called, and to rely on the finalizer to release resources.

Did this work before? N/A 

Chrome version: 54.0.2840.99  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 

Comment 1 by ajha@chromium.org, Nov 28 2016

Labels: M-54
Labels: TE-NeedsTriageHelp
Adding TE-NeedsTriageHelp label for further investigation.

Thanks.
Project Member

Comment 3 by sheriffbot@chromium.org, Nov 29 2017

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment