Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7095

Memory leak in sql_prepare.cc: Prepared_statement::execute_server_runnable()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.0(EOL)
    • N/A
    • Server
    • None

    Description

      Memory leak at sql_prepare.cc:
      Prepared_statement::execute_server_runnable().

      The memory was leaked because thd->lex was restored at the end of the function.

      The fix is that the lex allocated in this function should delete its explain before the function returns, i.e. Lex's "explain" query statement has to be deleted before restoring saved variables to thd to avoid memory leak.

      Code diff:

        error= server_runnable->execute_server_code(thd);
       
      +  // Lex's "explain" query statement has to be deleted before
      +  // restoring saved variables to thd to avoid memory leak.
      +  delete_explain_query(lex);
        thd->cleanup_after_query();

      Attachments

        Activity

          People

            serg Sergei Golubchik
            minli zhu Minli Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.