Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
3.0.3, 3.0.4
-
None
Description
The static analysis tool found a possible resource leak, which I am not sure if it is a false positive or not:
src/main/java/org/mariadb/jdbc/pool/Pool.java:
102 Statement stmt = idleConnections.getFirst().getConnection().createStatement();
(Variable "stmt" going out of scope leaks the resource it refers to. )
I could not find any piece of code, that would close this resource.
The Statement close() method docs[1] tells us, that it is only a good practice to close the resource manually, with, in this case, stmt.close().
Can you please check, if this finding is reasonable, or not?
[1] https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#close--