Lint Warning: WifiManagerLeak

RESOLVED FIXED in Firefox 66

Status

enhancement
P1
normal
RESOLVED FIXED
8 months ago
7 months ago

People

(Reporter: fluffyemily, Assigned: fluffyemily)

Tracking

(Blocks 1 bug)

unspecified
mozilla66
Dependency tree / graph

Firefox Tracking Flags

(geckoview64 wontfix, geckoview65 wontfix, geckoview66 fixed, firefox64 wontfix, firefox65 wontfix, firefox66 fixed)

Details

Attachments

(1 attachment)

On versions prior to Android N (24), initializing the WifiManager via Context#getSystemService can cause a memory leak if the context is not the application context.  

In many cases, it's not obvious from the code where the Context is coming from (e.g. it might be a parameter to a method, or a field initialized from various method calls). It's possible that the context being passed in is the application context, but to be on the safe side, you should consider changing context.getSystemService(...) to context.getApplicationContext().getSystemService(...).

Affected Class:

GeckoNetworkManager
See Also: → 1501024
Assignee: nobody → etoop
On versions prior to Android N (24), initializing the WifiManager via Context#getSystemService can cause a memory leak if the context is not the application context.
Product: Firefox for Android → GeckoView
Pushed by etoop@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d02e6cc785a9
Address WifiManager Potential Leak warning. r=geckoview-reviewers,snorp
https://hg.mozilla.org/mozilla-central/rev/d02e6cc785a9
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.