mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 06:38:05 +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:
committed by
Carlos R. Mafra
parent
c2a357fe1b
commit
659519f306
@@ -1569,8 +1569,6 @@ int wShowCrashingDialogPanel(int whatSig)
|
|||||||
int action;
|
int action;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
panel = wmalloc(sizeof(CrashPanel));
|
|
||||||
|
|
||||||
screen_no = DefaultScreen(dpy);
|
screen_no = DefaultScreen(dpy);
|
||||||
scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_no));
|
scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_no));
|
||||||
scr_height = HeightOfScreen(ScreenOfDisplay(dpy, screen_no));
|
scr_height = HeightOfScreen(ScreenOfDisplay(dpy, screen_no));
|
||||||
@@ -1581,6 +1579,8 @@ int wShowCrashingDialogPanel(int whatSig)
|
|||||||
return WMAbort;
|
return WMAbort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
panel = wmalloc(sizeof(CrashPanel));
|
||||||
|
|
||||||
panel->retKey = XKeysymToKeycode(dpy, XK_Return);
|
panel->retKey = XKeysymToKeycode(dpy, XK_Return);
|
||||||
|
|
||||||
panel->win = WMCreateWindow(scr, "crashingDialog");
|
panel->win = WMCreateWindow(scr, "crashingDialog");
|
||||||
|
|||||||
Reference in New Issue
Block a user