Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.6.4
    • N/A
    • Replication
    • None

    Description

      I have found a potential memory-leak bug in the project(version 10.6.4) and would like to report it to the maintainers.

      In function `my_alloc` in file `mysys/my_malloc.c`, `mh` is assigned with newly allocated memory at line 90 and then assigned to `point` at line 109, and `point` is returned to the caller at line 116.

      But in function `my_multi_malloc` (in file `mysys/mulalloc.c`) , `start` receives the allocated memory at line 51 and then is returned to the caller, where `start` is local.

      At last, the function`alloc_gtid_pos_table` in file `sql/rpl_gtid.cc` doesn't receives the return value(allocated memory) , which may lead to a memory-leak bug.

      Attachments

        Activity

          danblack Daniel Black added a comment -

          The &p and &allocated_string are the values in *ptr in the last while loop in my_multi_malloc. So the start returned is the same pointer in &p.

          So p contains the pointer to the entire block allocated.

          danblack Daniel Black added a comment - The &p and &allocated_string are the values in *ptr in the last while loop in my_multi_malloc. So the start returned is the same pointer in &p . So p contains the pointer to the entire block allocated.

          Closing because danblack's analysis is correct, and the memory is not leaked. Thank you JumpKnight for investigating, nonetheless!

          bnestere Brandon Nesterenko added a comment - Closing because danblack 's analysis is correct, and the memory is not leaked. Thank you JumpKnight for investigating, nonetheless!

          People

            Unassigned Unassigned
            JumpKnight JumpKnight
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.