* xmlBufferFree: * @buf: the buffer to free * * Frees an XML buffer. It frees both the content and the structure which * encapsulate it. */
| 7228 | * encapsulate it. |
| 7229 | */ |
| 7230 | void |
| 7231 | xmlBufferFree(xmlBufferPtr buf) { |
| 7232 | if (buf == NULL) { |
| 7233 | return; |
| 7234 | } |
| 7235 | |
| 7236 | if ((buf->alloc == XML_BUFFER_ALLOC_IO) && |
| 7237 | (buf->contentIO != NULL)) { |
| 7238 | xmlFree(buf->contentIO); |
| 7239 | } else if (buf->content != NULL) { |
| 7240 | xmlFree(buf->content); |
| 7241 | } |
| 7242 | xmlFree(buf); |
| 7243 | } |
| 7244 | |
| 7245 | /** |
| 7246 | * xmlBufferEmpty: |
no outgoing calls