Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-971

A static analysis has found a resource leak

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 3.0.3, 3.0.4
    • Fix Version/s: N/A
    • Component/s: Other
    • Labels:
      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--

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            zmiklank Zuzana Miklankova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.