ModSecurity icon indicating copy to clipboard operation
ModSecurity copied to clipboard

fix some memory leaks for parsing & cleaning up rules

Open Abce opened this issue 4 years ago • 4 comments

Abce avatar Jun 18 '21 02:06 Abce

great for "delete transformations"

877509395 avatar Aug 21 '21 10:08 877509395

@zimmerle What is holding you back from merging this? I also have a problem with these memory leaks, it would be great to merge it. ;)

poszu avatar Mar 28 '22 07:03 poszu

@poszu From my test in #2710, even patched this, there are many memory leak. Which g++ version do you use?

liudongmiao avatar Mar 28 '22 07:03 liudongmiao

@poszu From my test in #2710, even patched this, there are many memory leak. Which g++ version do you use?

Yes, I am aware of other leaks too. I'm using clang 10. ASAN reports plenty of leaks on the v3.0.6.

poszu avatar Mar 28 '22 09:03 poszu

I don't believe the portions of this PR related to filename are correct.

The problem is that location.hh is a generated file. The manual change to that file suggested in this PR could be made and a build done. But thereafter, any time bison rebuilt the generated files, those manual changes would be lost.

I'll go ahead and commit the other two fixes via a separate PR:

  • Rule class was missing a virtual destructor
  • delete of transformations vector

The parser-filename issue can be addressed later via a separate issue or PR.

martinhsv avatar Sep 15 '22 20:09 martinhsv

The two issues have been merged via #2801 .

Thanks @Abce

martinhsv avatar Sep 16 '22 12:09 martinhsv