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

As pointed by Coverity, the function 'ProgGetWMClass' always allocates the
strings returned in wm_class and wm_instance, so they always must be freed.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 src/dock.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/dock.c b/src/dock.c
index 6c76d1c..3fd3dbe 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -3204,8 +3204,11 @@ void wDockTrackWindowLaunch(WDock *dock, Window window)
        Bool found = False;
        char *command = NULL;
 
-       if (!PropGetWMClass(window, &wm_class, &wm_instance) || (!wm_class && 
!wm_instance))
+       if (!PropGetWMClass(window, &wm_class, &wm_instance)) {
+               free(wm_class);
+               free(wm_instance);
                return;
+       }
 
        command = GetCommandForWindow(window);
  retry:
-- 
1.9.2


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

Reply via email to