<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7034">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Messaging: Report error on failure to register tech or handler.<br><br>Message tech and handler registrations use a vector which could fail to<br>expand. If it does log and error and return error.<br><br>Change-Id: I593a8de81a07fb0452e9b0efd5d4018b77bca6f4<br>---<br>M main/message.c<br>1 file changed, 12 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/34/7034/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/message.c b/main/message.c<br>index fcdf705..ac7965e 100644<br>--- a/main/message.c<br>+++ b/main/message.c<br>@@ -1362,7 +1362,12 @@<br> return -1;<br> }<br> <br>- AST_VECTOR_APPEND(&msg_techs, tech);<br>+ if (AST_VECTOR_APPEND(&msg_techs, tech)) {<br>+ ast_log(LOG_ERROR, "Failed to register message technology for '%s'\n",<br>+ tech->name);<br>+ ast_rwlock_unlock(&msg_techs_lock);<br>+ return -1;<br>+ }<br> ast_verb(3, "Message technology '%s' registered.\n", tech->name);<br> <br> ast_rwlock_unlock(&msg_techs_lock);<br>@@ -1417,7 +1422,12 @@<br> return -1;<br> }<br> <br>- AST_VECTOR_APPEND(&msg_handlers, handler);<br>+ if (AST_VECTOR_APPEND(&msg_handlers, handler)) {<br>+ ast_log(LOG_ERROR, "Failed to register message handler for '%s'\n",<br>+ handler->name);<br>+ ast_rwlock_unlock(&msg_handlers_lock);<br>+ return -1;<br>+ }<br> ast_verb(2, "Message handler '%s' registered.\n", handler->name);<br> <br> ast_rwlock_unlock(&msg_handlers_lock);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7034">change 7034</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7034"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I593a8de81a07fb0452e9b0efd5d4018b77bca6f4 </div>
<div style="display:none"> Gerrit-Change-Number: 7034 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>