1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 22:52:34 +01:00

WINGs: fix possible NULL pointer dereference in WMFreeColorPanel (Coverity #50189)

As pointed by Coverity, the code was checking for NULL pointer to avoid
misbehaviour, but it actually dereferenced the pointer beforehand so the
crash would still happen.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-18 21:31:48 +02:00
committed by Carlos R. Mafra
parent 354ec080ad
commit 21c891e669

View File

@@ -1097,15 +1097,16 @@ WMColorPanel *WMGetColorPanel(WMScreen * scrPtr)
void WMFreeColorPanel(WMColorPanel * panel)
{
W_Screen *scr = WMWidgetScreen(panel->win);
if (panel == scr->sharedColorPanel) {
scr->sharedColorPanel = NULL;
}
W_Screen *scr;
if (!panel)
return;
scr = WMWidgetScreen(panel->win);
if (panel == scr->sharedColorPanel) {
scr->sharedColorPanel = NULL;
}
WMRemoveNotificationObserver(panel);
WMUnmapWidget(panel->win);