From 698bd00b983cebf65ccae4c491624ee8e2e40701 Mon Sep 17 00:00:00 2001 From: NickYang <362148418@qq.com> Date: Tue, 25 Sep 2018 11:54:14 +0800 Subject: [PATCH] fix sonar major bugs Former-commit-id: 9233ae9abf6106e15153f7e5c3b4394178980d77 [formerly 816ad49cab27a3edacdd41aaf0e611b6524c53ff] [formerly 81093f734b02dd09e0f626d3508c081e38c891d4 [formerly 096f9ecfa4d3dcf378d08e318f29cda963a2f6f4]] Former-commit-id: 2ae4bc86def77866f44f7d45acee25d8fbd547c9 [formerly ede443ef8a5d9ac6235f36d1432eb10b67c5ac64] Former-commit-id: 93e876e1494c6330565ebf0eb372cd9cd5a6f7e4 --- Frame/Launcher/AFMain.cpp | 4 ++-- Frame/SDK/Core/AFDataTable.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Frame/Launcher/AFMain.cpp b/Frame/Launcher/AFMain.cpp index ee092411..59a80efa 100644 --- a/Frame/Launcher/AFMain.cpp +++ b/Frame/Launcher/AFMain.cpp @@ -276,13 +276,13 @@ bool ParseArgs(int argc, char* argv[]) std::cerr << parser; return false; } - catch (args::ParseError e) + catch (args::ParseError& e) { std::cerr << e.what() << std::endl; std::cerr << parser; return false; } - catch (args::ValidationError e) + catch (args::ValidationError& e) { std::cerr << e.what() << std::endl; std::cerr << parser; diff --git a/Frame/SDK/Core/AFDataTable.cpp b/Frame/SDK/Core/AFDataTable.cpp index 1e654426..dba4ee82 100644 --- a/Frame/SDK/Core/AFDataTable.cpp +++ b/Frame/SDK/Core/AFDataTable.cpp @@ -163,7 +163,7 @@ bool AFDataTable::AddRow(size_t row) RowData* old_row_data = mxRowDatas[row]; if (nullptr != old_row_data) { - delete row_data; + delete[] row_data; return false; } @@ -241,7 +241,7 @@ bool AFDataTable::AddRow(size_t row, const AFIDataList& data) RowData* old_row_data = mxRowDatas[row]; if (nullptr != old_row_data) { - delete row_data; + delete[] row_data; return false; }