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

Function xmlFreePatternInternal

ThirdParty/libxml2/vtklibxml2/pattern.c:232–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void
233xmlFreePatternInternal(xmlPatternPtr comp) {
234 xmlStepOpPtr op;
235 int i;
236
237 if (comp == NULL)
238 return;
239 if (comp->stream != NULL)
240 xmlFreeStreamComp(comp->stream);
241 if (comp->pattern != NULL)
242 xmlFree((xmlChar *)comp->pattern);
243 if (comp->steps != NULL) {
244 if (comp->dict == NULL) {
245 for (i = 0;i < comp->nbStep;i++) {
246 op = &comp->steps[i];
247 if (op->value != NULL)
248 xmlFree((xmlChar *) op->value);
249 if (op->value2 != NULL)
250 xmlFree((xmlChar *) op->value2);
251 }
252 }
253 xmlFree(comp->steps);
254 }
255 if (comp->dict != NULL)
256 xmlDictFree(comp->dict);
257
258 memset(comp, -1, sizeof(xmlPattern));
259 xmlFree(comp);
260}
261
262/**
263 * xmlFreePatternList:

Callers 1

xmlFreePatternListFunction · 0.85

Calls 2

xmlFreeStreamCompFunction · 0.85
xmlDictFreeFunction · 0.85

Tested by

no test coverage detected