<p>One of the problems we met is solved by commit <a href="https://github.com/kamailio/kamailio/commit/44fdac69eb864125b4d02af0c650ce735dcf7aa8" class="commit-link"><tt>44fdac6</tt></a>. Also there are many uses of shm/pkg_str_dup() where the src is not NULL checked right before doing the dup (probably NULL check is done on higher levels but some mistakes might happen).</p>

<p>I think you are right with setting dst->s=NULL only if src->s == NULL. Updated the pull request to respect this.</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/pull/401#issuecomment-157720978">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZVZj1K8bAnyk5L3lYUL5SbjnKDXrks5pHHvegaJpZM4Gkk2w.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/401#issuecomment-157720978"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>