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 *rest;
|
||||
|
||||
file_read(&file, path);
|
||||
|
||||
config->map = hashmap_new(sizeof(ConfigFileItem), 0, 0, 0, item_hash,
|
||||
item_compare, NULL, NULL);
|
||||
|
||||
file_read(&file, path);
|
||||
|
||||
if (file.error) {
|
||||
config->error = true;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user