From: Jon Trulson Date: Mon, 2 Apr 2018 00:41:11 +0000 (-0600) Subject: dtcreate/fileio.c: coverity CID 175094; dref bef NULL X-Git-Tag: 2.2.4a~139 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4b9bcae29f3bbf6623cd9b3416c973930efeaedf;p=oweals%2Fcde.git dtcreate/fileio.c: coverity CID 175094; dref bef NULL --- diff --git a/cde/programs/dtcreate/fileio.c b/cde/programs/dtcreate/fileio.c index ba1a0b3e..f4d27d82 100644 --- a/cde/programs/dtcreate/fileio.c +++ b/cde/programs/dtcreate/fileio.c @@ -412,6 +412,9 @@ ushort WriteDefinitionFile(char *pszFile, ActionData *pAD) char *ptr; char *msgPtr, *fmtPtr, *errPtr; + if (!pszFile) + return 1; + /***************************************************************************/ /* Open action and filetypes definition file for writing. */ /***************************************************************************/ @@ -613,10 +616,11 @@ ushort WriteDefinitionFile(char *pszFile, ActionData *pAD) } } SetCookie(fp); - if (fp) fclose(fp); - if(pszFile) { - chmod(pszFile, 0644); - } + if (fp) + fclose(fp); + + chmod(pszFile, 0644); + return(0); }