Removes memory leak on the "offset" feature

This commit is contained in:
Felipe Zimmerle
2017-01-22 23:41:54 -03:00
committed by Felipe Zimmerle
parent c1f11ab4e5
commit 17e5a63577
3 changed files with 25 additions and 31 deletions

View File

@@ -33,8 +33,18 @@ namespace modsecurity {
/** @ingroup ModSecurity_CPP_API */
class VariableOrigin {
public:
VariableOrigin() { }
virtual std::string toText() = 0;
VariableOrigin()
: m_length(0),
m_offset(0) { }
std::string toText() {
std::string offset = std::to_string(m_offset);
std::string len = std::to_string(m_length);
return "rr:" + offset + "," + len;
}
int m_length;
size_t m_offset;
};