Fix memory leaks for 'username' and 'password' credentials in cluster 'pull' actions

pull/3921/head
Javier Jaramago Fernández 4 years ago
parent c46a805c70
commit b34100ceec

@ -1249,6 +1249,12 @@ void ProxySQL_Cluster::pull_mysql_users_from_peer(const string& expected_checksu
}
}
}
if (username) {
free(username);
}
if (password) {
free(password);
}
__exit_pull_mysql_users_from_peer:
if (conn) {
if (conn->net.pvio) {
@ -1741,6 +1747,12 @@ void ProxySQL_Cluster::pull_mysql_servers_from_peer(const std::string& checksum,
metrics.p_counter_array[p_cluster_counter::pulled_mysql_servers_failure]->Increment();
}
}
if (username) {
free(username);
}
if (password) {
free(password);
}
__exit_pull_mysql_servers_from_peer:
if (conn) {
if (conn->net.pvio) {
@ -1913,6 +1925,12 @@ void ProxySQL_Cluster::pull_global_variables_from_peer(const string& var_type, c
metrics.p_counter_array[failure_metric]->Increment();
}
}
if (username) {
free(username);
}
if (password) {
free(password);
}
__exit_pull_mysql_variables_from_peer:
if (conn) {
if (conn->net.pvio) {
@ -2016,6 +2034,12 @@ void ProxySQL_Cluster::pull_proxysql_servers_from_peer(const std::string& expect
metrics.p_counter_array[p_cluster_counter::pulled_proxysql_servers_failure]->Increment();
}
}
if (username) {
free(username);
}
if (password) {
free(password);
}
__exit_pull_proxysql_servers_from_peer:
if (conn) {
if (conn->net.pvio) {

Loading…
Cancel
Save