<p><a href="https://github.com/miconda" class="user-mention">@miconda</a> Makes sense. No need to malloc/free if it isn't absolutely required for a commonly used code path. I'll look over the patch and see if I can see a better approach(using flags to signify malloced pointer). One of the larger concerns here was that clang's address sanitizer was pointing out that at least one of the cases there was a pointer to stack memory being returned, which could lead to bad things as that stack frame was used by another thread.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/611#issuecomment-218471897">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZRkfkL8yw-K7QUdBEQfx_QZPtkXQks5qAeQUgaJpZM4Ibi7N.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/pull/611#issuecomment-218471897"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>