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

WMaker: fix memory leak in the crash handling dialog (Coverity #50163)

As pointed by Coverity, if the function wShowCrashingDialogPanel is not
able to connect to the default screen, then the memory allocated for the
panel would be leaked.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-20 21:46:42 +02:00
committed by Carlos R. Mafra
parent c2a357fe1b
commit 659519f306

View File

@@ -1569,8 +1569,6 @@ int wShowCrashingDialogPanel(int whatSig)
int action;
char buf[256];
panel = wmalloc(sizeof(CrashPanel));
screen_no = DefaultScreen(dpy);
scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_no));
scr_height = HeightOfScreen(ScreenOfDisplay(dpy, screen_no));
@@ -1581,6 +1579,8 @@ int wShowCrashingDialogPanel(int whatSig)
return WMAbort;
}
panel = wmalloc(sizeof(CrashPanel));
panel->retKey = XKeysymToKeycode(dpy, XK_Return);
panel->win = WMCreateWindow(scr, "crashingDialog");