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) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user