summaryrefslogtreecommitdiff
path: root/common/ini
diff options
context:
space:
mode:
Diffstat (limited to 'common/ini')
-rw-r--r--common/ini/ini_config.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/common/ini/ini_config.c b/common/ini/ini_config.c
index fd1efb02..7effc042 100644
--- a/common/ini/ini_config.c
+++ b/common/ini/ini_config.c
@@ -163,7 +163,7 @@ static int ini_to_collection(const char *filename,
if (error) {
TRACE_ERROR_NUMBER("Failed to create error collection", error);
fclose(file);
- return EOK;
+ return error;
}
created = 1;
}
@@ -195,7 +195,10 @@ static int ini_to_collection(const char *filename,
TRACE_ERROR_NUMBER("Failed to create collection", error);
fclose(file);
destroy_collection(current_section);
- if (created) destroy_collection(*error_list);
+ if (created) {
+ destroy_collection(*error_list);
+ *error_list = NULL;
+ }
return error;
}
}
@@ -209,7 +212,10 @@ static int ini_to_collection(const char *filename,
TRACE_ERROR_NUMBER("Failed to add pair to collection", error);
fclose(file);
destroy_collection(current_section);
- if (created) destroy_collection(*error_list);
+ if (created) {
+ destroy_collection(*error_list);
+ *error_list = NULL;
+ }
return error;
}
break;
@@ -231,7 +237,10 @@ static int ini_to_collection(const char *filename,
TRACE_ERROR_NUMBER("Failed to add collection", error);
fclose(file);
destroy_collection(current_section);
- if (created) destroy_collection(*error_list);
+ if (created) {
+ destroy_collection(*error_list);
+ *error_list = NULL;
+ }
return error;
}
}
@@ -255,7 +264,10 @@ static int ini_to_collection(const char *filename,
TRACE_ERROR_NUMBER("Failed to add error to collection", error);
fclose(file);
destroy_collection(current_section);
- if (created) destroy_collection(*error_list);
+ if (created) {
+ destroy_collection(*error_list);
+ *error_list = NULL;
+ }
return error;
}
/* Exit if there was an error parsing file */
@@ -277,7 +289,10 @@ static int ini_to_collection(const char *filename,
TRACE_ERROR_NUMBER("Failed to add warning to collection", error);
fclose(file);
destroy_collection(current_section);
- if (created) destroy_collection(*error_list);
+ if (created) {
+ destroy_collection(*error_list);
+ *error_list = NULL;
+ }
return error;
}
/* Exit if we are told to exit on warnings */