summaryrefslogtreecommitdiff
path: root/res/res_sorcery_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_sorcery_config.c')
-rw-r--r--res/res_sorcery_config.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/res/res_sorcery_config.c b/res/res_sorcery_config.c
index 312015c05..220b5875f 100644
--- a/res/res_sorcery_config.c
+++ b/res/res_sorcery_config.c
@@ -129,7 +129,6 @@ static int sorcery_config_fields_cmp(void *obj, void *arg, int flags)
{
const struct sorcery_config_fields_cmp_params *params = arg;
RAII_VAR(struct ast_variable *, objset, NULL, ast_variables_destroy);
- RAII_VAR(struct ast_variable *, diff, NULL, ast_variables_destroy);
if (params->regex) {
/* If a regular expression has been provided see if it matches, otherwise move on */
@@ -139,11 +138,10 @@ static int sorcery_config_fields_cmp(void *obj, void *arg, int flags)
return 0;
} else if (params->fields &&
(!(objset = ast_sorcery_objectset_create(params->sorcery, obj)) ||
- (ast_sorcery_changeset_create(objset, params->fields, &diff)) ||
- diff)) {
+ (!ast_variable_lists_match(objset, params->fields, 0)))) {
/* If we can't turn the object into an object set OR if differences exist between the fields
- * passed in and what are present on the object they are not a match.
- */
+ * passed in and what are present on the object they are not a match.
+ */
return 0;
}
@@ -197,6 +195,7 @@ static void sorcery_config_retrieve_multiple(const struct ast_sorcery *sorcery,
if (!config_objects) {
return;
}
+
ao2_callback(config_objects, 0, sorcery_config_fields_cmp, &params);
}