* @ingroup netbuf * Deallocate a netbuf allocated by netbuf_new(). * * @param buf pointer to a netbuf allocated by netbuf_new() */
| 78 | * @param buf pointer to a netbuf allocated by netbuf_new() |
| 79 | */ |
| 80 | void |
| 81 | netbuf_delete(struct netbuf *buf) |
| 82 | { |
| 83 | if (buf != NULL) { |
| 84 | if (buf->p != NULL) { |
| 85 | pbuf_free(buf->p); |
| 86 | buf->p = buf->ptr = NULL; |
| 87 | } |
| 88 | memp_free(MEMP_NETBUF, buf); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * @ingroup netbuf |