1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +01:00

WMaker: fix memory leak in wDockTrackWindowLaunch (Coverity #50120 and #50121)

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.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-20 21:46:34 +02:00
committed by Carlos R. Mafra
parent d292c62080
commit bee02df72f

View File

@@ -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: