Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dulmarod opened this issue Apr 21, 2015 · 2 comments
Open

Comments

@dulmarod
Copy link

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 dulmarod changed the title Resource leak -- file not closed -- in app/src/main/java/com/koushikdutta/async/util/StreamUtility.java Resource leak -- file not closed -- found by Facebook's static analyzer Apr 21, 2015
@omerjerk
Copy link
Owner

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

@dulmarod
Copy link
Author

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 [notifications@github.com]
Received: Tuesday, 21 Apr 2015, 8:36pm
To: omerjerk/RemoteDroid [RemoteDroid@noreply.github.com]
CC: Dulma Rodriguez [dulmarod@fb.com]
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//issues/2#issuecomment-94914099.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants