Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two rule-reload memory leak issues #2801

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

martinhsv
Copy link
Contributor

This PR commits two of three issues originally submitted in #2580.

@liudongmiao
Copy link
Contributor

@martinhsv I suggest to avoid use:

if (transformations != NULL) {
    delete transformations;
}

It's confused to free memory of constructor argument.

In the similiar #2728, I use shared_ptr to avoid delete.

For virtual ~Rule, it's ok. I have explained other solutions too: #2728 (comment)

@martinhsv
Copy link
Contributor Author

@liudongmiao ,

This way of deleting the transactions vector has some disadvantages, but it is that way in this PR because:

  • that is how it was coded in the original PR, which this is replacing
  • this way is consistent with how 'actions' was already being handled

@martinhsv martinhsv merged commit 5d2b86c into owasp-modsecurity:v3/master Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants