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