<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/3259#discussion_r33243028">sys/net/crosslayer/ng_pktbuf_dynamic/ng_pktbuf_dynamic.c</a>:</p>
<pre style='color:#555'>> +    snip->data = data;
> +    snip->size = size;
> +    snip->type = type;
> +}
> +
> +static ng_pktsnip_t *_alloc(void *data, size_t size,
> +                         ng_nettype_t type, ng_pktsnip_t *pkt)
> +{
> +    ng_pktsnip_t *snip;
> +    void *tmp;
> +
> +    snip = (ng_pktsnip_t *)malloc(sizeof(ng_pktsnip_t));
> +    tmp = malloc(size);
> +    if ((snip == NULL) || (tmp == NULL)) {
> +        free(snip);
> +        free(tmp);
</pre>
<p>Here and below: I'm not sure if free'ing NULL pointers works. </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/RIOT-OS/RIOT/pull/3259/files#r33243028">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AEn7YBhNTMLMSYcVJDzuWMfB_4T6Jerqks5oW9ZbgaJpZM4FLL8p.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/RIOT-OS/RIOT/pull/3259/files#r33243028"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>