| |
@@ -823,14 +823,14 @@
|
| |
if (ret) {
|
| |
if (error_list) {
|
| |
uint32_t i;
|
| |
- uint32_t len = ref_array_getlen(error_list, &i);
|
| |
+ uint32_t len = ref_array_len(error_list);
|
| |
for (i = 0; i < len; i++) {
|
| |
- GPDEBUG("Error when reading config directory: %s\n",
|
| |
- (const char *) ref_array_get(error_list, i, NULL));
|
| |
+ GPAUDIT("Error when reading config directory: %s\n",
|
| |
+ *(char **)ref_array_get(error_list, i, NULL));
|
| |
}
|
| |
ref_array_destroy(error_list);
|
| |
} else {
|
| |
- GPDEBUG("Error when reading config directory number: %d\n", ret);
|
| |
+ GPAUDIT("Error when reading config directory number: %d\n", ret);
|
| |
}
|
| |
return ret;
|
| |
}
|
| |
This is a bugfix when handling errors in gp_config_from_dir. Per docs, ref_array_getlen returns a status code (0/EINVAL) and not the length of the array; the second parameter,
i
, is assigned the length of the array. Thusi >= 0
andlen == 0
, soi >= len
and the for loop is never triggered.Second, due to the implementation, error_list is a list of pointers to error message strings. This does not need to be freed as ini_config_augment handles this for us.