mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 10:20:35 +03:00
Using shared var for variables names
This commit is contained in:
@@ -53,10 +53,8 @@ void AnchoredSetVariable::set(const std::string &key,
|
||||
const std::string &value, size_t offset, size_t len) {
|
||||
std::unique_ptr<VariableOrigin> origin(new VariableOrigin());
|
||||
std::string *v = new std::string(value);
|
||||
std::string *k = new std::string(m_name + ":" + key);
|
||||
collection::Variable *var = new collection::Variable(k, v);
|
||||
collection::Variable *var = new collection::Variable(std::make_shared<std::string>(m_name + ":" + key), v);
|
||||
delete v;
|
||||
delete k;
|
||||
|
||||
origin->m_offset = offset;
|
||||
origin->m_length = len;
|
||||
@@ -70,10 +68,8 @@ void AnchoredSetVariable::set(const std::string &key,
|
||||
const std::string &value, size_t offset) {
|
||||
std::unique_ptr<VariableOrigin> origin(new VariableOrigin());
|
||||
std::string *v = new std::string(value);
|
||||
std::string *k = new std::string(m_name + ":" + key);
|
||||
collection::Variable *var = new collection::Variable(k, v);
|
||||
collection::Variable *var = new collection::Variable(std::make_shared<std::string>(m_name + ":" + key), v);
|
||||
delete v;
|
||||
delete k;
|
||||
|
||||
origin->m_offset = offset;
|
||||
origin->m_length = value.size();
|
||||
|
||||
Reference in New Issue
Block a user