[Static Analysis] Resources leaked in gecko/media/GeckoMediaDrmBridgeV21.java

RESOLVED FIXED in Firefox 63

Status

defect
P3
normal
RESOLVED FIXED
Last year
7 months ago

People

(Reporter: rbartlensky, Assigned: rbartlensky)

Tracking

unspecified
mozilla63
Unspecified
Android
Dependency tree / graph

Firefox Tracking Flags

(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

Details

Attachments

(1 attachment)

mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java:507: error: RESOURCE_LEAK
  resource of type `java.io.InputStreamReader` acquired by call to `new()` at line 493 is not released after line 507.
**Note**: potential exception at line 497
  505.                       Log.d(LOGTAG, "Provisioning, server returned HTTP error code :" + responseCode);
  506.                   }
  507. >             } catch (IOException e) {
  508.                   Log.e(LOGTAG, "Got exception during posting provisioning request ...", e);
  509.               } catch (URISyntaxException e) {

mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java:505: error: RESOURCE_LEAK
  resource of type `java.net.HttpURLConnection` acquired by call to `openConnectionWithProxy(...)` at line 478 is not released after line 505.
  503.                       if (mResponseBody != null) Log.d(LOGTAG, "response length=" + mResponseBody.length);
  504.                   } else {
  505. >                     Log.d(LOGTAG, "Provisioning, server returned HTTP error code :" + responseCode);
  506.                   }
  507.               } catch (IOException e) {

mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java:493: error: RESOURCE_LEAK
  resource of type `java.net.HttpURLConnection` acquired to `urlConnection` by call to `openConnectionWithProxy(...)` at line 478 is not released after line 493.
  491.                   if (responseCode == HttpURLConnection.HTTP_OK) {
  492.                       BufferedReader in =
  493. >                       new BufferedReader(new InputStreamReader(urlConnection.getInputStream(), StringUtils.UTF_8));
  494.                       String inputLine;
  495.                       StringBuffer response = new StringBuffer();
Comment on attachment 8991571 [details]
Bug 1474967: Fix resource leaks.

https://reviewboard.mozilla.org/r/256498/#review263528

Sure.
Attachment #8991571 - Flags: review?(nalexander) → review+
Blocks: infer
https://hg.mozilla.org/mozilla-central/rev/dd8b72cfda82
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
I'm setting status-firefox62=wontfix because potential resource leaks in DRM video playback won't affect many users. If you think this is a serious issue, please feel free to change status-firefox62 and request beta uplift.
OS: Unspecified → Android
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 63 → mozilla63
You need to log in before you can comment on or make changes to this bug.