From 6397f3403a74511680736e04fce44731156e6e5c Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 29 Nov 2014 16:35:30 +0100 Subject: [PATCH] util: return from 'findCopyFile' if the source file could not be found (Coverity #50075) As pointed by Coverity, the function handles the case where the file to be copied is not found by properly warning the user and the deleting the currently built theme directory, but then it continued executing the file copy that would crash on the null pointer. This patch just adds the missing return that will avoid the crash. Signed-off-by: Christophe CURIS --- util/getstyle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/getstyle.c b/util/getstyle.c index c39d266e..2b7edb9d 100644 --- a/util/getstyle.c +++ b/util/getstyle.c @@ -172,6 +172,7 @@ static void findCopyFile(const char *dir, const char *file) wwarning("Could not find file %s", file); if (ThemePath) (void)wrmdirhier(ThemePath); + return; } wcopy_file(dir, fullPath, fullPath); free(fullPath);