* xmlBufFree: * @buf: the buffer to free * * Frees an XML buffer. It frees both the content and the structure which * encapsulate it. */
| 273 | * encapsulate it. |
| 274 | */ |
| 275 | void |
| 276 | xmlBufFree(xmlBufPtr buf) { |
| 277 | if (buf == NULL) { |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | if ((buf->alloc == XML_BUFFER_ALLOC_IO) && |
| 282 | (buf->contentIO != NULL)) { |
| 283 | xmlFree(buf->contentIO); |
| 284 | } else if (buf->content != NULL) { |
| 285 | xmlFree(buf->content); |
| 286 | } |
| 287 | xmlFree(buf); |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * xmlBufEmpty: |
no outgoing calls
no test coverage detected