MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlFreeParserCtxt

Function xmlFreeParserCtxt

ThirdParty/libxml2/vtklibxml2/parserInternals.c:2468–2546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2466 */
2467
2468void
2469xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
2470{
2471 xmlParserInputPtr input;
2472
2473 if (ctxt == NULL) return;
2474
2475 while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */
2476 xmlFreeInputStream(input);
2477 }
2478 if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
2479 if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
2480 if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
2481 if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
2482 if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
2483 if (ctxt->version != NULL) xmlFree((char *) ctxt->version);
2484 if (ctxt->encoding != NULL) xmlFree((char *) ctxt->encoding);
2485 if (ctxt->extSubURI != NULL) xmlFree((char *) ctxt->extSubURI);
2486 if (ctxt->extSubSystem != NULL) xmlFree((char *) ctxt->extSubSystem);
2487#ifdef LIBXML_SAX1_ENABLED
2488 if ((ctxt->sax != NULL) &&
2489 (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
2490#else
2491 if (ctxt->sax != NULL)
2492#endif /* LIBXML_SAX1_ENABLED */
2493 xmlFree(ctxt->sax);
2494 if (ctxt->directory != NULL) xmlFree(ctxt->directory);
2495 if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
2496 if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
2497 if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
2498 if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
2499 if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
2500 if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
2501 if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
2502 if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
2503 if (ctxt->attsDefault != NULL)
2504 xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
2505 if (ctxt->attsSpecial != NULL)
2506 xmlHashFree(ctxt->attsSpecial, NULL);
2507 if (ctxt->freeElems != NULL) {
2508 xmlNodePtr cur, next;
2509
2510 cur = ctxt->freeElems;
2511 while (cur != NULL) {
2512 next = cur->next;
2513 xmlFree(cur);
2514 cur = next;
2515 }
2516 }
2517 if (ctxt->freeAttrs != NULL) {
2518 xmlAttrPtr cur, next;
2519
2520 cur = ctxt->freeAttrs;
2521 while (cur != NULL) {
2522 next = cur->next;
2523 xmlFree(cur);
2524 cur = next;
2525 }

Callers 15

xmlParseCatalogFileFunction · 0.85
testSAXFunction · 0.85
parseFileFunction · 0.85
xmllint.cFile · 0.85
xmlconfTestInvalidFunction · 0.85
xmlconfTestValidFunction · 0.85
xmlconfTestNotNSWFFunction · 0.85
xmlconfTestNotWFFunction · 0.85
htmlFreeParserCtxtFunction · 0.85
htmlCreateDocParserCtxtFunction · 0.85
htmlCreateFileParserCtxtFunction · 0.85

Calls 6

inputPopFunction · 0.85
xmlFreeInputStreamFunction · 0.85
xmlDictFreeFunction · 0.85
xmlParserNsFreeFunction · 0.85
xmlHashFreeFunction · 0.85
xmlCatalogFreeLocalFunction · 0.85

Tested by 6

saxParseTestFunction · 0.68
pushParseTestFunction · 0.68
pushBoundaryTestFunction · 0.68
errParseTestFunction · 0.68
fdParseTestFunction · 0.68
xmlidDocTestFunction · 0.68