mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Handles better the memory utilization
- Added reference counts to Rule and AuditLog; - Some memory leaks were removed, including GeoLookup; - Deal better with parser errors; - Overriding the AutlogLogWritter destructor.
This commit is contained in:
@@ -40,12 +40,17 @@ std::list<std::pair<std::string, std::string>>
|
||||
std::map<std::string, std::string> envs;
|
||||
for (char **current = environ; *current; current++) {
|
||||
std::string env = std::string(*current);
|
||||
std::vector<std::string> key_value = split(env, '=');
|
||||
envs.insert(std::pair<std::string, std::string>("ENV:" + key_value[0],
|
||||
key_value[1]));
|
||||
if ("env:" + key_value[0] == name) {
|
||||
size_t pos = env.find_first_of("=");
|
||||
if (pos == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
std::string key = std::string(env, 0, pos);
|
||||
std::string value = std::string(env, pos+1, env.length() - (pos + 1));
|
||||
|
||||
envs.insert(std::pair<std::string, std::string>("ENV:" + key, value));
|
||||
if ("env:" + key == name) {
|
||||
std::pair<std::string, std::string> pair;
|
||||
pair = std::make_pair(name, key_value[1]);
|
||||
pair = std::make_pair(name, value);
|
||||
resl.push_back(pair);
|
||||
return resl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user