void test_free (void *memory) { if (memory) /* we guarantee it's safe to free (NULL) */ { n_blocks_outstanding -= 1; xmlMemFree (memory); } }
NamespaceList Node::NamespacesInScope() const { NamespaceList result; xmlNsPtr *pNamespaces = xmlGetNsList(_xml->doc, _xml); if ( pNamespaces == nullptr ) return result; for ( int i = 0; pNamespaces[i] != nullptr; i++ ) { xmlNsPtr xmlNs = pNamespaces[i]; result.push_back(Wrapped<class Namespace, _xmlNs>(xmlNs)); } xmlMemFree(pNamespaces); return result; }
OutputBuffer::~OutputBuffer() { xmlMemFree(_buf); _buf = nullptr; }