Fix invalid 'write-after-free' reported by ASAN

pull/3866/head
--global 4 years ago committed by Javier Jaramago Fernández
parent 44d6e48c7b
commit 52ea5abfa9

@ -11895,8 +11895,8 @@ char * ProxySQL_Admin::load_mysql_query_rules_to_runtime() {
}
GloQPro->sort(false);
GloQPro->load_fast_routing(resultset2);
GloQPro->wrunlock();
GloQPro->commit();
GloQPro->wrunlock();
}
if (resultset) delete resultset;
// if (resultset2) delete resultset2; // never delete it. GloQPro saves it

@ -737,10 +737,8 @@ void Query_Processor::sort(bool lock) {
// when commit is called, the version number is increased and the this will trigger the mysql threads to get a new Query Processor Table
// The operation is asynchronous
void Query_Processor::commit() {
pthread_rwlock_wrlock(&rwlock);
__sync_add_and_fetch(&version,1);
proxy_debug(PROXY_DEBUG_MYSQL_QUERY_PROCESSOR, 4, "Increasing version number to %d - all threads will notice this and refresh their rules\n", version);
pthread_rwlock_unlock(&rwlock);
};
SQLite3_result * Query_Processor::get_stats_commands_counters() {

Loading…
Cancel
Save