ModSecurity icon indicating copy to clipboard operation
ModSecurity copied to clipboard

fix: Sonarcloud memleak fixes

Open airween opened this issue 1 year ago • 2 comments

This pull request fixes two memory leaks, reported by SonarCloud.

None of them modified the library itself.

airween avatar Mar 27 '24 10:03 airween

This block makes no sense.

The variable is initialized as an empty string in line 49 in each cycle.

49.      std::string argFull("");

therefore the condition's left side (argFull.empty()) is always true which means the condition itself

54.        if (argFull.empty() == false) {

is always false. Moreover, in the two branches in that block after the append() the code jumps to the next label, where the cycle ends...

So I'm going to remove it.

airween avatar Mar 27 '24 14:03 airween