[riot-notifications] [RIOT] net: added new dynamic packet buffer implementation (#3259)

Martine Lenders notifications at github.com
Thu Jun 25 12:58:35 CEST 2015


> +    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);

Here and below: I'm not sure if free'ing NULL pointers works. 

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3259/files#r33243028
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150625/676564cb/attachment.html>


More information about the notifications mailing list