Skip to content

Commit

Permalink
make sure config file was actually opened (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
scareything authored Dec 4, 2020
1 parent 7160cde commit 0fd8d9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ int load_config_file(const char *filename, ziti_config **cfg) {
}

FILE *file = fopen(filename, "r");
if (file == NULL) {
ZITI_LOG(ERROR, "%s - %s", filename, strerror(errno));
return ZITI_CONFIG_NOT_FOUND;
}

size_t config_len = (size_t) stats.st_size;
char *config = malloc(config_len);
Expand Down

0 comments on commit 0fd8d9d

Please sign in to comment.