CID 182717 call fclose, always

This commit is contained in:
Enno Rehling 2018-02-08 08:33:27 +01:00
parent 4f63cf12b2
commit 87081a37bc
1 changed files with 4 additions and 2 deletions

View File

@ -932,6 +932,7 @@ static int include_json(const char *uri) {
FILE *F;
char name[PATH_MAX];
const char *filename = uri_to_file(uri, name, sizeof(name));
int result = -1;
F = fopen(filename, "r");
if (F) {
@ -952,15 +953,16 @@ static int include_json(const char *uri) {
if (config) {
json_config(config);
cJSON_Delete(config);
result = 0;
}
else {
log_error("could not parse JSON from %s", uri);
return -1;
result = -1;
}
}
fclose(F);
}
return 0;
return result;
}
static int include_xml(const char *uri) {