From: Christophe CURIS <christophe.cu...@free.fr>

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.cu...@free.fr>
---
 src/dialog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dialog.c b/src/dialog.c
index 1102747..8eb01f1 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");
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to