<p>Here's a clue...<br>
If I populate $avp(cnam) with a dummy value before calling http_query then I end up with 2 indexes of $avp(cnam) with the expected values and no segfault.<br>
If I leave http_query() to create $avp(cnam), there is no $avp(cnam) in a dbg_pv_dump() after http_query and I get the segfault.<br><br>
Likewise, if I put a <code>$avp(cnam) = $null</code> before the http_query, it then shows up properly in dbg_pv_dump() with a single index.</p>

<p>So it seems like it's a problem with http_query having to initialize an avp but if the avp is referenced at all prior to the http_query call, then it's fine.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/212#issuecomment-112613179">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZeP-4LA7keXBfd1m4sKEV8KF7LRPks5oULlOgaJpZM4FEq4p.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/212#issuecomment-112613179"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>