1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtcreate/fileio.c: coverity CID 175094; dref bef NULL

This commit is contained in:
Jon Trulson 2018-04-01 18:41:11 -06:00
parent dbe044c24c
commit 4b9bcae29f

View file

@ -412,6 +412,9 @@ ushort WriteDefinitionFile(char *pszFile, ActionData *pAD)
char *ptr; char *ptr;
char *msgPtr, *fmtPtr, *errPtr; char *msgPtr, *fmtPtr, *errPtr;
if (!pszFile)
return 1;
/***************************************************************************/ /***************************************************************************/
/* Open action and filetypes definition file for writing. */ /* Open action and filetypes definition file for writing. */
/***************************************************************************/ /***************************************************************************/
@ -613,10 +616,11 @@ ushort WriteDefinitionFile(char *pszFile, ActionData *pAD)
} }
} }
SetCookie(fp); SetCookie(fp);
if (fp) fclose(fp); if (fp)
if(pszFile) { fclose(fp);
chmod(pszFile, 0644);
} chmod(pszFile, 0644);
return(0); return(0);
} }