<p>Shouldn't you fix the caller that pkg_free's without checking for NULL instead?</p>

<p>If you "allow" it, then you might as well drop all the <code>if(buf)</code> before every <code>pkg_free(buf)</code>. Allowing both makes the code inconsistent.</p>

<p>Right?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/commit/17d639b9f11b415d51062005aadb86dd6c2375e2#commitcomment-11680174">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciYfEwvVEBp29g8hxa5U2YL9raTKNks5oTsrrgaJpZM4FDXKs.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/OpenSIPS/opensips/commit/17d639b9f11b415d51062005aadb86dd6c2375e2#commitcomment-11680174"></link>
    <meta itemprop="name" content="View Commit"></meta>
  </div>
  <meta itemprop="description" content="View this Commit on GitHub"></meta>
</div>