This is an automated email from the ASF dual-hosted git repository.
dmeden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 774b315707 Coverity: Fix several new issues. (#11947)
774b315707 is described below
commit 774b31570783abe4de387b5753d7504519db7c34
Author: Damian Meden <[email protected]>
AuthorDate: Thu Jan 9 19:17:48 2025 +0100
Coverity: Fix several new issues. (#11947)
1587284, 1587279, 1587272, 1587269, 1587266, 1587265, 1587259, 1587252.
---
src/traffic_ctl/CtrlPrinters.cc | 4 ++--
src/traffic_ctl/PrintUtils.cc | 6 +++---
src/traffic_ctl/jsonrpc/CtrlRPCRequests.h | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/traffic_ctl/CtrlPrinters.cc b/src/traffic_ctl/CtrlPrinters.cc
index 8f42e72f41..1458cc8a9f 100644
--- a/src/traffic_ctl/CtrlPrinters.cc
+++ b/src/traffic_ctl/CtrlPrinters.cc
@@ -122,7 +122,7 @@ RecordPrinter::write_output(YAML::Node const &result)
}
if (is_records_format() && recordList.size() > 0) {
- std::cout << RecNameToYaml{recordList, should_include_default()}.string()
<< '\n';
+ std::cout << RecNameToYaml{std::move(recordList),
should_include_default()}.string() << '\n';
}
// we print errors if found.
print_record_error_list(response.errorList);
@@ -162,7 +162,7 @@ DiffConfigPrinter::write_output(YAML::Node const &result)
}
if (is_records_format() && recordList.size() > 0) {
- std::cout << RecNameToYaml{recordList, WithDefaults}.string() << '\n';
+ std::cout << RecNameToYaml{std::move(recordList), WithDefaults}.string()
<< '\n';
}
}
//------------------------------------------------------------------------------------------------------------------------------------
diff --git a/src/traffic_ctl/PrintUtils.cc b/src/traffic_ctl/PrintUtils.cc
index c0497f5a1c..f76a64cc40 100644
--- a/src/traffic_ctl/PrintUtils.cc
+++ b/src/traffic_ctl/PrintUtils.cc
@@ -87,7 +87,7 @@ RecNameToYaml::RecNameToYaml(RecInfoList records, bool
p_include_defaults) : inc
recs.push_back(std::make_pair(e, false));
}
- build_yaml(recs);
+ build_yaml(std::move(recs));
}
RecNameToYaml::RecordsMatchTracker
@@ -156,7 +156,7 @@ RecNameToYaml::process_var_from_prefix(std::string prefix,
RecNameToYaml::RecLis
in_a_map = true; // no need for a map down the line if we will just add
k,v.
YAML_begin_map(doc);
- process_var_from_prefix(nprefix, vars, in_a_map);
+ process_var_from_prefix(std::move(nprefix), vars, in_a_map);
YAML_end_map(doc);
}
}
@@ -197,7 +197,7 @@ RecNameToYaml::build_yaml(RecNameToYaml::RecList vars)
}
bool in_a_map = true;
YAML_begin_map(doc);
- process_var_from_prefix(prefix, vars, in_a_map);
+ process_var_from_prefix(std::move(prefix), vars, in_a_map);
YAML_end_map(doc);
}
diff --git a/src/traffic_ctl/jsonrpc/CtrlRPCRequests.h
b/src/traffic_ctl/jsonrpc/CtrlRPCRequests.h
index 23cc810565..7ca103d036 100644
--- a/src/traffic_ctl/jsonrpc/CtrlRPCRequests.h
+++ b/src/traffic_ctl/jsonrpc/CtrlRPCRequests.h
@@ -227,7 +227,7 @@ struct ConfigStatusRequest :
shared::rpc::RecordLookupRequest {
};
//------------------------------------------------------------------------------------------------------------------------------------
struct SetDebugServerRequest : ConfigSetRecordRequest {
- SetDebugServerRequest(bool enabled, std::string tags, std::string client_ip)
+ SetDebugServerRequest(bool enabled, std::string const &tags, std::string
const &client_ip)
{
std::string enable_value{(enabled ? "1" : "0")};
if (!client_ip.empty()) {
@@ -239,6 +239,6 @@ struct SetDebugServerRequest : ConfigSetRecordRequest {
super::params.push_back(Params{"proxy.config.diags.debug.tags", tags});
}
- super::params.push_back(Params{"proxy.config.diags.debug.enabled",
enable_value});
+ super::params.push_back(Params{"proxy.config.diags.debug.enabled",
std::move(enable_value)});
}
};