Android: ContentUriUtils.contentUriExists() leaks ParcelFileDescriptor
Reported by
comparea...@gmail.com,
Nov 28 2016
|
|||
Issue descriptionUserAgent: 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
,
Nov 29 2016
Adding TE-NeedsTriageHelp label for further investigation. Thanks.
,
Nov 29 2017
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
,
Nov 29 2017
Looks fixed in 3be618619e8365afe55130c44da9a24941cc34c4 |
|||
►
Sign in to add a comment |
|||
Comment 1 by ajha@chromium.org
, Nov 28 2016