<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6977">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_stasis_device_state.c: Pull stack alloc out of loop.<br><br>Change-Id: Ia27e64a884afa0f50b9ffdb1cf23da6bfa51ffdf<br>---<br>M res/res_stasis_device_state.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/77/6977/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_stasis_device_state.c b/res/res_stasis_device_state.c<br>index 276a98b..41c12bc 100644<br>--- a/res/res_stasis_device_state.c<br>+++ b/res/res_stasis_device_state.c<br>@@ -171,11 +171,12 @@<br>         RAII_VAR(struct ast_db_entry *, tree,<br>                  ast_db_gettree(DEVICE_STATE_FAMILY, NULL), ast_db_freetree);<br>         struct ast_db_entry *entry;<br>+  struct ast_str *device = ast_str_alloca(DEVICE_STATE_SIZE);<br> <br>        for (entry = tree; entry; entry = entry->next) {<br>           const char *name = strrchr(entry->key, '/');<br>+<br>            if (!ast_strlen_zero(name)) {<br>-                        struct ast_str *device = ast_str_alloca(DEVICE_STATE_SIZE);<br>                   ast_str_set(&device, 0, "%s%s",<br>                                     DEVICE_STATE_SCHEME_STASIS, ++name);<br>                      ast_json_array_append(<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6977">change 6977</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/6977"/><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: Ia27e64a884afa0f50b9ffdb1cf23da6bfa51ffdf </div>
<div style="display:none"> Gerrit-Change-Number: 6977 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>