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
1 changed files with 8 additions and 4 deletions

View File

@ -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);
}