1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-01 11:32:34 +01:00

WINGs: fix check for NULL pointer in WMFilePanel (Coverity #50195)

As pointed by Coverity, there is a NULL pointer check at the end of the
function 'deleteFile' (which happens to not be necessary because wfree was
made to accept NULL pointers), however there are many things done before
that assumes the pointer is not NULL. The check is moved to where it
matters.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-18 21:31:50 +02:00
committed by Carlos R. Mafra
parent e65f527ad4
commit 28ce91a901

View File

@@ -695,6 +695,9 @@ static void deleteFile(WMWidget *widget, void *p_panel)
(void) widget;
file = getCurrentFileName(panel);
if (file == NULL)
return;
normalizePath(file);
if (stat(file, &filestat) == -1) {
@@ -725,8 +728,7 @@ static void deleteFile(WMWidget *widget, void *p_panel)
}
out:
if (file)
wfree(file);
wfree(file);
}
static void goUnmount(WMWidget *widget, void *p_panel)