* @ingroup netbuf * Free the packet buffer included in a netbuf * * @param buf pointer to the netbuf which contains the packet buffer to free */
| 124 | * @param buf pointer to the netbuf which contains the packet buffer to free |
| 125 | */ |
| 126 | void |
| 127 | netbuf_free(struct netbuf *buf) |
| 128 | { |
| 129 | LWIP_ERROR("netbuf_free: invalid buf", (buf != NULL), return;); |
| 130 | if (buf->p != NULL) { |
| 131 | pbuf_free(buf->p); |
| 132 | } |
| 133 | buf->p = buf->ptr = NULL; |
| 134 | #if LWIP_CHECKSUM_ON_COPY |
| 135 | buf->flags = 0; |
| 136 | buf->toport_chksum = 0; |
| 137 | #endif /* LWIP_CHECKSUM_ON_COPY */ |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * @ingroup netbuf |
no test coverage detected