fix: config_file_read dont initialize hashmap on file error
This commit is contained in:
+2
-2
@@ -68,11 +68,11 @@ void config_file_read(ConfigFile *config, const char *path) {
|
|||||||
char *line;
|
char *line;
|
||||||
char *rest;
|
char *rest;
|
||||||
|
|
||||||
|
file_read(&file, path);
|
||||||
|
|
||||||
config->map = hashmap_new(sizeof(ConfigFileItem), 0, 0, 0, item_hash,
|
config->map = hashmap_new(sizeof(ConfigFileItem), 0, 0, 0, item_hash,
|
||||||
item_compare, NULL, NULL);
|
item_compare, NULL, NULL);
|
||||||
|
|
||||||
file_read(&file, path);
|
|
||||||
|
|
||||||
if (file.error) {
|
if (file.error) {
|
||||||
config->error = true;
|
config->error = true;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user