From 659519f3065862a348d13f89ebb98db34cb4c056 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Tue, 20 May 2014 21:46:42 +0200 Subject: [PATCH] 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 --- src/dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dialog.c b/src/dialog.c index 11027471..8eb01f1a 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -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");