commit 85cff54a5f610cf003dcd2517f7147e50bbfbfe3
parent 43a0aef29fdf4bb1c3bddce39870bdd6b8d0878c
Author: Joris Vink <joris@coders.se>
Date: Tue, 10 Apr 2018 14:39:57 +0200
don't let kore_parse_config_file() call fclose.
It doesn't own the FILE pointer, it shouldn't call fclose() on it,
thats just confusing.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyko/src/pyko.c b/pyko/src/pyko.c
@@ -65,6 +65,6 @@ kore_parent_configure(int argc, char **argv)
if (chdir(module) == -1)
fatal("chdir(%s): %s", module, errno_s);
- /* kore_parse_config_file() will call fclose(). */
kore_parse_config_file(fp);
+ (void)fclose(fp);
}
diff --git a/src/config.c b/src/config.c
@@ -204,6 +204,7 @@ kore_parse_config(void)
#endif
kore_parse_config_file(fp);
+ (void)fclose(fp);
if (!kore_module_loaded())
fatal("no application module was loaded");
@@ -295,8 +296,6 @@ kore_parse_config_file(FILE *fp)
printf("ignoring \"%s\" on line %d\n", p, lineno);
lineno++;
}
-
- fclose(fp);
}
static int
@@ -308,6 +307,7 @@ configure_include(char *path)
fatal("failed to open include '%s'", path);
kore_parse_config_file(fp);
+ (void)fclose(fp);
return (KORE_RESULT_OK);
}