Fixed few anomalies detected with valgrind

pull/1269/head
René Cannaò 9 years ago
parent 8ebc2b0f50
commit 7f567048d2

@ -1977,9 +1977,9 @@ void MySQL_Threads_Handler::init(unsigned int num, size_t stack) {
}
int rc=pthread_attr_setstacksize(&attr, stacksize);
assert(rc==0);
mysql_threads=(proxysql_mysql_thread_t *)malloc(sizeof(proxysql_mysql_thread_t)*num_threads);
mysql_threads=(proxysql_mysql_thread_t *)calloc(num_threads,sizeof(proxysql_mysql_thread_t));
#ifdef IDLE_THREADS
mysql_threads_idles=(proxysql_mysql_thread_t *)malloc(sizeof(proxysql_mysql_thread_t)*num_threads);
mysql_threads_idles=(proxysql_mysql_thread_t *)calloc(num_threads,sizeof(proxysql_mysql_thread_t));
#endif // IDLE_THREADS
}

@ -196,6 +196,9 @@ MySQL_Connection::~MySQL_Connection() {
delete userinfo;
userinfo=NULL;
}
if (local_stmts) {
delete local_stmts;
}
if (mysql) {
// always decrease the counter
if (ret_mysql)
@ -207,9 +210,6 @@ MySQL_Connection::~MySQL_Connection() {
if (MyRS) {
delete MyRS;
}
if (local_stmts) {
delete local_stmts;
}
if (query.stmt) {
query.stmt=NULL;
}

Loading…
Cancel
Save