summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-04-29 10:13:03 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-04-29 10:13:03 -0500
commit48d5971a82ee8ef4474cbba3ab2286b76cef219d (patch)
tree289f40a1f6b5f27702c09272cf29781f9a8f9c17
parentd6ecbbac0a731fa19f8ee9a80c8709f2bf3cc4c0 (diff)
parent46cf643c755f3133d74e37d06a5f0c0b1074e702 (diff)
Merge "chan_pjsip: Creating Channel Causes Asterisk to Crash When Duplicate AOR Sections Exist in pjsip.conf"
-rw-r--r--res/res_sorcery_config.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/res/res_sorcery_config.c b/res/res_sorcery_config.c
index 60ecb8311..deb2ffadd 100644
--- a/res/res_sorcery_config.c
+++ b/res/res_sorcery_config.c
@@ -294,6 +294,18 @@ static void sorcery_config_internal_load(void *data, const struct ast_sorcery *s
continue;
}
+ /* Confirm an object with this id does not already exist in the bucket.
+ * If it exists, however, the configuration is invalid so stop
+ * processing and destroy it. */
+ obj = ao2_find(objects, id, OBJ_KEY;
+
+ if (obj) {
+ ast_log(LOG_ERROR, "Config file '%s' could not be loaded; configuration contains a duplicate object: '%s' of type '%s'\n",
+ config->filename, id, type);
+ ast_config_destroy(cfg);
+ return;
+ }
+
if (!(obj = ast_sorcery_alloc(sorcery, type, id)) ||
ast_sorcery_objectset_apply(sorcery, obj, ast_category_first(category))) {