From fab73f47c71d851de7ff71533b17540dde5659b2 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Tue, 20 May 2014 21:46:39 +0200 Subject: [PATCH] WMaker: fix memory leak in screen initialisation (Coverity #50134) As pointed by Coverity, if the function wScreenInit fails to properly attach to the screen then the storage structure and content were not released before returning. Signed-off-by: Christophe CURIS --- src/screen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/screen.c b/src/screen.c index afc9d17d..bb9d9b3f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -593,6 +593,12 @@ WScreen *wScreenInit(int screen_number) if (!scr->wmscreen) { wfatal(_("could not initialize WINGs widget set")); + RDestroyContext(scr->rcontext); + WMFreeArray(scr->fakeGroupLeaders); + wfree(scr->totalUsableArea); + wfree(scr->usableArea); + WMFreeBag(scr->stacking_list); + wfree(scr); return NULL; }