mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Use rvalue reference in ModSecurity::serverLog to avoid string copy
This commit is contained in:
committed by
Felipe Zimmerle
parent
ccd7b9f677
commit
fd9a161e74
@@ -196,10 +196,9 @@ void ModSecurity::serverLog(void *data, std::shared_ptr<RuleMessage> rm) {
|
||||
}
|
||||
|
||||
if (m_logProperties & TextLogProperty) {
|
||||
char *d = strdup(rm->log().c_str());
|
||||
const void *a = static_cast<const void *>(d);
|
||||
std::string &&d = rm->log();
|
||||
const void *a = static_cast<const void *>(d.c_str());
|
||||
m_logCb(data, a);
|
||||
free(d);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user