RemoteDroid icon indicating copy to clipboard operation
RemoteDroid copied to clipboard

Resource leak -- file not closed -- found by Facebook's static analyzer

Open dulmarod opened this issue 9 years ago • 2 comments

Hello, This resource leak report, included with comments below, were found by running

Facebook's Infer static analyzer on RemoteDroid.

Regards, Dulma Rodriguez Facebook Static Analysis Tools Team

File: app/src/main/java/com/koushikdutta/async/util/StreamUtility.java

Report: Resource Leak: resource acquired by call to FileOutputStream(...) at line 83 is not released after line 86.

Remarks: The problem seems to be that dout.write(...) can throw an exception, in which case dout.close() won't get called. A simple fix is to put the call to close in a finally clause.

dulmarod avatar Apr 21 '15 11:04 dulmarod

Hi @dulmarod, Thanks for pointing it out. Btw, how did you generate this result ?

omerjerk avatar Apr 21 '15 19:04 omerjerk

Hi, The result was generated by running a static analysis tool that we are developing at Facebook. It finds bugs by analysing the source code of the programme, without running it. As a test, we wanted to run it in some open source apps.

Sent from my Android phone using Symantec TouchDown (www.symantec.com)

-----Original Message----- From: Umair Khan [[email protected]] Received: Tuesday, 21 Apr 2015, 8:36pm To: omerjerk/RemoteDroid [[email protected]] CC: Dulma Rodriguez [[email protected]] Subject: Re: [RemoteDroid] Resource leak -- file not closed -- found by Facebook's static analyzer (#2)

Hi @dulmarodhttps://github.com/dulmarod, Thanks for pointing it out. Btw, how did you generate this result ?

— Reply to this email directly or view it on GitHubhttps://github.com/omerjerk/RemoteDroid/issues/2#issuecomment-94914099.

dulmarod avatar Apr 21 '15 20:04 dulmarod