Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.1, 1.2.0
-
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);
|