From 5f0d77a3c22bb54ae479b4b22ff39b117267f64d Mon Sep 17 00:00:00 2001 From: bx0 Date: Mon, 14 Mar 2022 20:29:51 +0800 Subject: [PATCH] When is_sensitive is true, memory leak. --- src/observer/mysql/ob_mysql_request_manager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/observer/mysql/ob_mysql_request_manager.cpp b/src/observer/mysql/ob_mysql_request_manager.cpp index 9e42521d54..23146853cf 100644 --- a/src/observer/mysql/ob_mysql_request_manager.cpp +++ b/src/observer/mysql/ob_mysql_request_manager.cpp @@ -199,9 +199,12 @@ int ObMySQLRequestManager::record_request(const ObAuditRecordData& audit_record, } // push into queue - if (OB_SUCC(ret) && !is_sensitive) { + if (OB_SUCC(ret)) { int64_t req_id = 0; - if (OB_FAIL(queue_.push(record, req_id))) { + if (is_sensitive) { + free(record); + record = NULL; + } else if (OB_FAIL(queue_.push(record, req_id))) { if (REACH_TIME_INTERVAL(2 * 1000 * 1000)) { SERVER_LOG(WARN, "push into queue failed", K(ret)); } -- GitLab