prevent double closing of file (Linux does not NULL fp during fclose)

This commit is contained in:
Holger Vogt 2020-02-23 15:38:49 +01:00
parent 99cfe7bc81
commit 9f8509d53c
1 changed files with 1 additions and 0 deletions

View File

@ -468,6 +468,7 @@ static Table3_Data_t *init_local_data(const char *filename, int interporder)
lFileRead = fread(cFile, sizeof(char), lFileLen, fp);
const int file_error = ferror(fp);
fclose(fp); /* done with file */
fp = (FILE *) NULL;
if (file_error) {
cm_message_printf("Error reading data file %s", filename);
xrc = -1;