summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-11-07 14:31:59 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-11-07 14:31:59 -0600
commit5a60ce3ee3b1534a73689ec4621e717998b3f454 (patch)
tree8b13c224e7ee753b31b2539163d0f05c23c91399
parentcb1ec6255f82537d671f63698598838b6fe7edff (diff)
parent75539dbf2cdd282a1cdad1b7d8167c2d3d80e999 (diff)
Merge "Messaging: Report error on failure to register tech or handler." into 13
-rw-r--r--main/message.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/main/message.c b/main/message.c
index be0035d30..caee37c81 100644
--- a/main/message.c
+++ b/main/message.c
@@ -1364,7 +1364,12 @@ int ast_msg_tech_register(const struct ast_msg_tech *tech)
return -1;
}
- AST_VECTOR_APPEND(&msg_techs, tech);
+ if (AST_VECTOR_APPEND(&msg_techs, tech)) {
+ ast_log(LOG_ERROR, "Failed to register message technology for '%s'\n",
+ tech->name);
+ ast_rwlock_unlock(&msg_techs_lock);
+ return -1;
+ }
ast_verb(3, "Message technology '%s' registered.\n", tech->name);
ast_rwlock_unlock(&msg_techs_lock);
@@ -1419,7 +1424,12 @@ int ast_msg_handler_register(const struct ast_msg_handler *handler)
return -1;
}
- AST_VECTOR_APPEND(&msg_handlers, handler);
+ if (AST_VECTOR_APPEND(&msg_handlers, handler)) {
+ ast_log(LOG_ERROR, "Failed to register message handler for '%s'\n",
+ handler->name);
+ ast_rwlock_unlock(&msg_handlers_lock);
+ return -1;
+ }
ast_verb(2, "Message handler '%s' registered.\n", handler->name);
ast_rwlock_unlock(&msg_handlers_lock);