| 230 | } |
| 231 | |
| 232 | static void |
| 233 | xmlFreePatternInternal(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: |
no test coverage detected