Skip to content

Commit 9ea50a4

Browse files
committed
Change arg from pass-by-value (satisify cppcheck)
1 parent c34bd91 commit 9ea50a4

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/parser/driver.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Driver::~Driver() {
4343
}
4444

4545

46-
int Driver::addSecMarker(std::string marker, std::unique_ptr<std::string> fileName, int lineNumber) {
46+
int Driver::addSecMarker(const std::string& marker, std::unique_ptr<std::string> fileName, int lineNumber) {
4747
// FIXME: we might move this to the parser.
4848
for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) {
4949
RuleMarker *r = new RuleMarker(marker, std::unique_ptr<std::string>(new std::string(*fileName)), lineNumber);

src/parser/driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Driver : public RulesSetProperties {
6060

6161
int addSecRule(std::unique_ptr<RuleWithActions> rule);
6262
int addSecAction(std::unique_ptr<RuleWithActions> rule);
63-
int addSecMarker(std::string marker, std::unique_ptr<std::string> fileName, int lineNumber);
63+
int addSecMarker(const std::string& marker, std::unique_ptr<std::string> fileName, int lineNumber);
6464
int addSecRuleScript(std::unique_ptr<RuleScript> rule);
6565

6666
bool scan_begin();

test/cppcheck_suppressions.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ ctunullpointer:src/rule_with_operator.cc:135
6060
ctunullpointer:src/rule_with_operator.cc:95
6161
passedByValue:src/variables/global.h:109
6262
passedByValue:src/variables/global.h:110
63-
passedByValue:src/parser/driver.cc:46
6463
passedByValue:test/common/modsecurity_test.cc:49
6564
passedByValue:test/common/modsecurity_test.cc:98
6665
unreadVariable:src/rule_with_operator.cc:219

0 commit comments

Comments
 (0)