Minor memory leak fix

pull/1643/head
René Cannaò 8 years ago
parent 29fb0d211f
commit 0fdd52b46d

@ -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<uint32_t, stmt_execute_metadata_t *>::iterator it=m.begin(); it!=m.end(); ++it) {
stmt_execute_metadata_t *sem=it->second;
delete sem;

@ -625,6 +625,7 @@ static void * HGCU_thread_run() {
}
free(statuses);
free(errs);
free(ret);
}
}

@ -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<uint64_t, MySQL_STMT_Global_info *>(); // map using statement id
map_stmt_hash_to_info = std::map<uint64_t, MySQL_STMT_Global_info *>(); // map using hashes
free_stmt_ids = std::stack<uint64_t> ();
map_stmt_id_to_info= std::map<uint64_t, MySQL_STMT_Global_info *>(); // map using statement id
map_stmt_hash_to_info = std::map<uint64_t, MySQL_STMT_Global_info *>(); // map using hashes
free_stmt_ids = std::stack<uint64_t> ();
next_statement_id =
1; // we initialize this as 1 because we 0 is not allowed

Loading…
Cancel
Save