Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-227

Memory leak in Galera Monitor

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.1, 1.2.0
    • 1.2.0
    • galeramon
    • None

    Description

      Memory leak between line 383 and 408 of galeramon.c in develop branch

      In the following code section result from previous query should be freed before the second query (SHOW VARIABLES LIKE 'wsrep_sst_method'). Not doing so will leak memory allocated to result of previous query.

      		while ((row = mysql_fetch_row(result)))
      		{
      			if (strcmp(row[1], "4") == 0) 
      				isjoined = 1;
      	
      			/* Check if the node is a donor and is using xtrabackup, in this case it can stay alive */
      			else if (strcmp(row[1], "2") == 0 && handle->availableWhenDonor == 1) {
      				if (mysql_query(database->con, "SHOW VARIABLES LIKE 'wsrep_sst_method'") == 0
      					&& (result = mysql_store_result(database->con)) != NULL)
      				{
      				    		if(mysql_field_count(database->con) < 2)
      						{
      						    mysql_free_result(result);
      						    skygw_log_write(LE,"Error: Unexpected result for \"SHOW VARIABLES LIKE 'wsrep_sst_method'\". Expected 2 columns."
      							    " MySQL Version: %s",version_str);
      						    return;
      						}
      					while ((row = mysql_fetch_row(result)))
      					{
      						if (strncmp(row[1], "xtrabackup", 10) == 0)
      							isjoined = 1;
      					}
      				}
      			}
      		}
      		mysql_free_result(result);

      Attachments

        Activity

          People

            markus makela markus makela
            dshjoshi Dipti Joshi (Inactive)
            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.