<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8825">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: Fix initialization of extended stringfields.<br><br>It is possible for initialization of extended stringfields to fail.  Add<br>checks for this failure.<br><br>Change-Id: I062e09852db3d37ceefaf6c2048958fa0118304f<br>---<br>M res/res_pjsip/location.c<br>M res/res_pjsip/pjsip_configuration.c<br>2 files changed, 7 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c<br>index 52d84c3..3abba3b 100644<br>--- a/res/res_pjsip/location.c<br>+++ b/res/res_pjsip/location.c<br>@@ -118,15 +118,14 @@<br>                 return NULL;<br>  }<br> <br>- if (ast_string_field_init(contact, 256)) {<br>+   if (ast_string_field_init(contact, 256)<br>+              || ast_string_field_init_extended(contact, endpoint_name)<br>+            || ast_string_field_init_extended(contact, reg_server)<br>+               || ast_string_field_init_extended(contact, via_addr)<br>+         || ast_string_field_init_extended(contact, call_id)) {<br>                ao2_cleanup(contact);<br>                 return NULL;<br>  }<br>-<br>- ast_string_field_init_extended(contact, endpoint_name);<br>-      ast_string_field_init_extended(contact, reg_server);<br>- ast_string_field_init_extended(contact, via_addr);<br>-   ast_string_field_init_extended(contact, call_id);<br> <br>  /* Dynamic contacts are delimited with ";@" and static ones with "@@" */<br>  if ((aor_separator = strstr(id, ";@")) || (aor_separator = strstr(id, "@@"))) {<br>diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c<br>index e88f019..5e5d40c 100644<br>--- a/res/res_pjsip/pjsip_configuration.c<br>+++ b/res/res_pjsip/pjsip_configuration.c<br>@@ -2197,12 +2197,11 @@<br>     if (!endpoint) {<br>              return NULL;<br>  }<br>-    if (ast_string_field_init(endpoint, 64)) {<br>+   if (ast_string_field_init(endpoint, 64)<br>+              || ast_string_field_init_extended(endpoint, incoming_mwi_mailbox)) {<br>          ao2_cleanup(endpoint);<br>                return NULL;<br>  }<br>-<br>- ast_string_field_init_extended(endpoint, incoming_mwi_mailbox);<br> <br>    if (!(endpoint->media.codecs = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {<br>               ao2_cleanup(endpoint);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8825">change 8825</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/8825"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I062e09852db3d37ceefaf6c2048958fa0118304f </div>
<div style="display:none"> Gerrit-Change-Number: 8825 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>