diff --git a/include/MySQL_PreparedStatement.h b/include/MySQL_PreparedStatement.h index 0987721bf..1efae98fe 100644 --- a/include/MySQL_PreparedStatement.h +++ b/include/MySQL_PreparedStatement.h @@ -103,6 +103,10 @@ class stmt_execute_metadata_t { lengths = NULL; size = 0; stmt_id = 0; + if (pkt) { + free(pkt); + pkt = NULL; + } } }; @@ -139,7 +143,6 @@ class MySQL_STMTs_meta { num_entries=0; } ~MySQL_STMTs_meta() { - // FIXME: destructor not there yet for (std::map::iterator it=m.begin(); it!=m.end(); ++it) { stmt_execute_metadata_t *sem=it->second; delete sem; diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 3e4d84047..681d1a14a 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -625,6 +625,7 @@ static void * HGCU_thread_run() { } free(statuses); free(errs); + free(ret); } } diff --git a/lib/MySQL_PreparedStatement.cpp b/lib/MySQL_PreparedStatement.cpp index dcec6111e..b88127969 100644 --- a/lib/MySQL_PreparedStatement.cpp +++ b/lib/MySQL_PreparedStatement.cpp @@ -485,9 +485,9 @@ uint64_t MySQL_STMTs_local_v14::compute_hash(unsigned int hostgroup, char *user, MySQL_STMT_Manager_v14::MySQL_STMT_Manager_v14() { last_purge_time = time(NULL); pthread_rwlock_init(&rwlock_, NULL); - map_stmt_id_to_info= std::map(); // map using statement id - map_stmt_hash_to_info = std::map(); // map using hashes - free_stmt_ids = std::stack (); + map_stmt_id_to_info= std::map(); // map using statement id + map_stmt_hash_to_info = std::map(); // map using hashes + free_stmt_ids = std::stack (); next_statement_id = 1; // we initialize this as 1 because we 0 is not allowed