Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Resource Leaks, Null Deferences using FbInfer Tool #448

Open
codingblazer opened this issue Mar 21, 2017 · 0 comments
Open

Resource Leaks, Null Deferences using FbInfer Tool #448

codingblazer opened this issue Mar 21, 2017 · 0 comments

Comments

@codingblazer
Copy link
Member

I tested the app using Facebook infer tool which got Open Sourced recently for analysing the app. The following leaks and deferences were found -

app/src/main/java/com/peacecorps/pcsa/circle_of_trust/CircleOfTrustFragment.java:369: error: NULL_DEREFERENCE
  object CircleOfTrustFragment.phoneNumbers last assigned on line 356 could be null and is dereferenced at line 369
  367.                       editor.putString(NAME_KEY + i,phoneNumbers[i]);
  368.                   }
  369. >                 if(phoneNumbers[i].isEmpty()) {
  370.                       allTextViews[i].setText(getString(R.string.unregistered));
  371.                       editor.putString(NAME_KEY + i,getString(R.string.unregistered));

app/src/main/java/com/peacecorps/pcsa/circle_of_trust/MessageDialogBox.java:52: error: CONTEXT_LEAK
  Context class android.app.Activity may leak during method com.peacecorps.pcsa.circle_of_trust.MessageDialogBox.newInstance:
  Static field com.peacecorps.pcsa.circle_of_trust.MessageDialogBox.context |->
  Leaked class android.app.Activity
  50.           context = activity;
  51.           MessageDialogBox messageDialogBox = new MessageDialogBox();
  52. >         return messageDialogBox;
  53.       }
  54.   

app/src/main/java/com/peacecorps/pcsa/circle_of_trust/Trustees.java:232: error: RESOURCE_LEAK
   resource of type android.database.sqlite.SQLiteCursor acquired to cursor by call to query(...) at line 213 is not released after line 232
  230.               } finally {
  231.                   if (cursor != null) {
  232. >                     cursor.close();
  233.                   }
  234. 

@sandarumk If this seems valid to you, feel free to tag this as a free issue. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants