diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-11-07 14:58:05 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-07 14:58:05 -0600 |
commit | 64fa84b2ca2d67288400a8a2094cf076cb54c478 (patch) | |
tree | 29a0d66228c5c61cbd60bef90125690c6ea30c50 /main | |
parent | 3d5aa21fe5b49eaf65654fbc726da083ef843143 (diff) | |
parent | 714026b32e1494a11d2b5984e3516450feb4ed7d (diff) |
Merge "Messaging: Report error on failure to register tech or handler."
Diffstat (limited to 'main')
-rw-r--r-- | main/message.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/main/message.c b/main/message.c index fcdf705fe..ac7965ea7 100644 --- a/main/message.c +++ b/main/message.c @@ -1362,7 +1362,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); @@ -1417,7 +1422,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); |