* xmlRelaxNGFreeValidState: * @state: a validation state structure * * Deallocate a RelaxNG validation state structure. */
| 1353 | * Deallocate a RelaxNG validation state structure. |
| 1354 | */ |
| 1355 | static void |
| 1356 | xmlRelaxNGFreeValidState(xmlRelaxNGValidCtxtPtr ctxt, |
| 1357 | xmlRelaxNGValidStatePtr state) |
| 1358 | { |
| 1359 | if (state == NULL) |
| 1360 | return; |
| 1361 | |
| 1362 | if ((ctxt != NULL) && (ctxt->freeState == NULL)) { |
| 1363 | ctxt->freeState = xmlRelaxNGNewStates(ctxt, 40); |
| 1364 | } |
| 1365 | if ((ctxt == NULL) || (ctxt->freeState == NULL)) { |
| 1366 | if (state->attrs != NULL) |
| 1367 | xmlFree(state->attrs); |
| 1368 | xmlFree(state); |
| 1369 | } else { |
| 1370 | xmlRelaxNGAddStatesUniq(ctxt, ctxt->freeState, state); |
| 1371 | } |
| 1372 | } |
| 1373 | |
| 1374 | /************************************************************************ |
| 1375 | * * |
no test coverage detected