Return to buf.c CVS log | Up to [local] / src / usr.bin / cvs |
version 1.82, 2015/02/05 12:59:57 | version 1.83, 2015/11/05 09:48:21 | ||
---|---|---|---|
|
|
||
void | void | ||
buf_free(BUF *b) | buf_free(BUF *b) | ||
{ | { | ||
if (b->cb_buf != NULL) | if (b == NULL) | ||
xfree(b->cb_buf); | return; | ||
xfree(b); | free(b->cb_buf); | ||
free(b); | |||
} | } | ||
/* | /* | ||
* Free the buffer <b>'s structural information but do not free the contents | * Free the buffer <b>'s structural information but do not free the contents | ||
* of the buffer. Instead, they are returned and should be freed later using | * of the buffer. Instead, they are returned and should be freed later. | ||
* xfree(). | |||
*/ | */ | ||
void * | void * | ||
buf_release(BUF *b) | buf_release(BUF *b) | ||
|
|
||
void *tmp; | void *tmp; | ||
tmp = b->cb_buf; | tmp = b->cb_buf; | ||
xfree(b); | free(b); | ||
return (tmp); | return (tmp); | ||
} | } | ||