CID 22507: Dereference null return value (NULL_RETURNS)

checking fopen results
This commit is contained in:
Enno Rehling 2015-10-30 12:55:30 +01:00
parent d6bc1c3119
commit 8f7f182c91
1 changed files with 17 additions and 14 deletions

View File

@ -1705,6 +1705,7 @@ int crwritemap(const char *filename)
FILE *F = fopen(filename, "w"); FILE *F = fopen(filename, "w");
region *r; region *r;
if (F) {
fprintf(F, "VERSION %d\n", C_REPORT_VERSION); fprintf(F, "VERSION %d\n", C_REPORT_VERSION);
fputs("\"UTF-8\";charset\n", F); fputs("\"UTF-8\";charset\n", F);
@ -1723,6 +1724,8 @@ int crwritemap(const char *filename)
fclose(F); fclose(F);
return 0; return 0;
} }
return EOF;
}
void register_cr(void) void register_cr(void)
{ {