mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-08 23:04:15 +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:
committed by
Carlos R. Mafra
parent
354ec080ad
commit
21c891e669
@@ -1097,15 +1097,16 @@ WMColorPanel *WMGetColorPanel(WMScreen * scrPtr)
|
|||||||
|
|
||||||
void WMFreeColorPanel(WMColorPanel * panel)
|
void WMFreeColorPanel(WMColorPanel * panel)
|
||||||
{
|
{
|
||||||
W_Screen *scr = WMWidgetScreen(panel->win);
|
W_Screen *scr;
|
||||||
|
|
||||||
if (panel == scr->sharedColorPanel) {
|
|
||||||
scr->sharedColorPanel = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!panel)
|
if (!panel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
scr = WMWidgetScreen(panel->win);
|
||||||
|
if (panel == scr->sharedColorPanel) {
|
||||||
|
scr->sharedColorPanel = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
WMRemoveNotificationObserver(panel);
|
WMRemoveNotificationObserver(panel);
|
||||||
WMUnmapWidget(panel->win);
|
WMUnmapWidget(panel->win);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user