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

Function xmlXPathFreeCompExpr

ThirdParty/libxml2/vtklibxml2/xpath.c:915–958  ·  view source on GitHub ↗

* xmlXPathFreeCompExpr: * @comp: an XPATH comp * * Free up the memory allocated by @comp */

Source from the content-addressed store, hash-verified

913 * Free up the memory allocated by @comp
914 */
915void
916xmlXPathFreeCompExpr(xmlXPathCompExprPtr comp)
917{
918 xmlXPathStepOpPtr op;
919 int i;
920
921 if (comp == NULL)
922 return;
923 if (comp->dict == NULL) {
924 for (i = 0; i < comp->nbStep; i++) {
925 op = &comp->steps[i];
926 if (op->value4 != NULL) {
927 if (op->op == XPATH_OP_VALUE)
928 xmlXPathFreeObject(op->value4);
929 else
930 xmlFree(op->value4);
931 }
932 if (op->value5 != NULL)
933 xmlFree(op->value5);
934 }
935 } else {
936 for (i = 0; i < comp->nbStep; i++) {
937 op = &comp->steps[i];
938 if (op->value4 != NULL) {
939 if (op->op == XPATH_OP_VALUE)
940 xmlXPathFreeObject(op->value4);
941 }
942 }
943 xmlDictFree(comp->dict);
944 }
945 if (comp->steps != NULL) {
946 xmlFree(comp->steps);
947 }
948#ifdef XPATH_STREAMING
949 if (comp->stream != NULL) {
950 xmlFreePatternList(comp->stream);
951 }
952#endif
953 if (comp->expr != NULL) {
954 xmlFree(comp->expr);
955 }
956
957 xmlFree(comp);
958}
959
960/**
961 * xmlXPathCompExprAdd:

Callers 9

xmlXPathEvalExprFunction · 0.85
xmlSchematronFreeTestsFunction · 0.85
xmlSchematronFreeLetsFunction · 0.85
runtest.cFile · 0.85
getNextFunction · 0.85
getStringFunction · 0.85

Calls 3

xmlXPathFreeObjectFunction · 0.85
xmlDictFreeFunction · 0.85
xmlFreePatternListFunction · 0.85

Tested by

no test coverage detected