mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fix memory leak on VerifyCC operator
This commit is contained in:
parent
a4c7d534f2
commit
8b9041c2da
@ -26,6 +26,16 @@
|
||||
namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
VerifyCC::~VerifyCC() {
|
||||
if (m_pc != NULL) {
|
||||
pcre_free(m_pc);
|
||||
m_pc = NULL;
|
||||
}
|
||||
if (m_pce != NULL) {
|
||||
pcre_free_study(m_pce);
|
||||
m_pce = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Luhn Mod-10 Method (ISO 2894/ANSI 4.13)
|
||||
|
@ -31,6 +31,7 @@ class VerifyCC : public Operator {
|
||||
: Operator(op, param, negation),
|
||||
m_pc(NULL),
|
||||
m_pce(NULL) { }
|
||||
~VerifyCC();
|
||||
|
||||
int luhnVerify(const char *ccnumber, int len);
|
||||
bool evaluate(Transaction *transaction, const std::string &input) override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user