Use rvalue reference in ModSecurity::serverLog to avoid string copy

This commit is contained in:
Wenfeng Liu 2018-05-07 23:07:20 +00:00 committed by Felipe Zimmerle
parent ccd7b9f677
commit fd9a161e74
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -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;
}