Double free in ui_basic/panel.cc

Bug #1198928 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Invalid
Undecided
Unassigned

Bug Description

Found by scan-build (llvm 3.3) in r6594.

Double free looks like a new category reported, so I've filed this as a sample, so that people can assess whether this is a real issue or not.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :
Revision history for this message
SirVer (sirver) wrote :

This is a false positive - but one cannot blame clang for this. The reason ist that the variable will be reassigned in the destructor of the deleted child. This is very uncommon behavior and bad style, but will be non trivial to fix.

I think the other instances could be interesting to look at though. I cannot guess how often such a false positive will be in our code base.

Changed in widelands:
status: New → Invalid
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

I suspected this would turn out to be a false positive from the way it looked. Thanks for checking.

The other instance of this is in ui_basic/radiobutton.cc:89 which seems to be the exact same thing.

Revision history for this message
SirVer (sirver) wrote :

Yes, it is the same thing.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers