banditcpp / bandit

Human-friendly unit testing for C++11
https://banditcpp.github.io/bandit/
Other
259 stars 37 forks source link

Fix dangling pointer #170

Open milsen opened 9 months ago

milsen commented 9 months ago

The address of the local variable controller is still referenced to by the static variable controller_ after run() is executed and controller has been deallocated.

This issue was detected in a sonarcloud run for the OGDF. It's not that problematic because controller_ should not be touched again after run() has been executed, but it's the only bug in bandit that sonarcloud detected so I thought that it is worth fixing. Please check whether my changes actually make sense; I'm not that familiar with the bandit code base.