* Clear an sbuf, free its buffer if necessary. */
| 868 | * Clear an sbuf, free its buffer if necessary. |
| 869 | */ |
| 870 | void |
| 871 | sbuf_delete(struct sbuf *s) |
| 872 | { |
| 873 | int isdyn; |
| 874 | |
| 875 | assert_sbuf_integrity(s); |
| 876 | /* don't care if it's finished or not */ |
| 877 | |
| 878 | if (SBUF_ISDYNAMIC(s)) |
| 879 | SBFREE(s->s_buf); |
| 880 | isdyn = SBUF_ISDYNSTRUCT(s); |
| 881 | memset(s, 0, sizeof(*s)); |
| 882 | if (isdyn) |
| 883 | SBFREE(s); |
| 884 | } |
| 885 | |
| 886 | /* |
| 887 | * Check if an sbuf has been finished. |
no test coverage detected