facebook / facebook/infer

Resource Leak of android.database.sqlite.SQLiteCursor seems false positive within isClosed() branch

Open
#1,758 2 comments 2 reactions 0 assignees View on GitHub
false-positive java
Dominant language
OCaml
Stars
15.7k
Forks
2.1k
Avg merge
19h 36m
Merged PRs (30d)
13

Description

Please make sure your issue is not addressed in the [FAQ](https://fbinfer.com/docs/support#troubleshooting).

Please include the following information:
- [x] The version of infer from `infer --version`.
v1.1.0
- [x] Your operating system and version, for example "Debian 9", "MacOS High Sierra", whether you are using Docker, etc.
Ubuntu 20.04
- [x] Which command you ran, for example `infer -- make`.
infer run --pulse -- ./gradlew build
- [x] The full output in a paste, for instance a [gist](https://gist.github.com/).
resource of type `android.database.sqlite.SQLiteCursor` acquired by call to `query(...)` at line 99 is not released after line 110.
108. }
109. } finally {
110. > if (!cursor.isClosed()) {
111. cursor.close();
112. }
- [x] If possible, a minimal example to reproduce your problem (for instance, some code where
infer reports incorrectly, together with the way you run infer to reproduce the incorrect
report).
`isClosed` is the Android API:
https://developer.android.com/reference/android/database/Cursor#isClosed()

**Can we avoid this FP by set the `.inferconfig` options ?**
thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.