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

A static analysis has found a resource leak

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 3.0.3, 3.0.4
    • N/A
    • Other
    • 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

            diego dupin Diego Dupin
            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.