| 3517 | } |
| 3518 | |
| 3519 | static void |
| 3520 | xmlFARegExecSaveInputString(xmlRegExecCtxtPtr exec, const xmlChar *value, |
| 3521 | void *data) { |
| 3522 | if (exec->inputStackMax == 0) { |
| 3523 | exec->inputStackMax = 4; |
| 3524 | exec->inputStack = (xmlRegInputTokenPtr) |
| 3525 | xmlMalloc(exec->inputStackMax * sizeof(xmlRegInputToken)); |
| 3526 | if (exec->inputStack == NULL) { |
| 3527 | exec->inputStackMax = 0; |
| 3528 | exec->status = XML_REGEXP_OUT_OF_MEMORY; |
| 3529 | return; |
| 3530 | } |
| 3531 | } else if (exec->inputStackNr + 1 >= exec->inputStackMax) { |
| 3532 | xmlRegInputTokenPtr tmp; |
| 3533 | |
| 3534 | exec->inputStackMax *= 2; |
| 3535 | tmp = (xmlRegInputTokenPtr) xmlRealloc(exec->inputStack, |
| 3536 | exec->inputStackMax * sizeof(xmlRegInputToken)); |
| 3537 | if (tmp == NULL) { |
| 3538 | exec->inputStackMax /= 2; |
| 3539 | exec->status = XML_REGEXP_OUT_OF_MEMORY; |
| 3540 | return; |
| 3541 | } |
| 3542 | exec->inputStack = tmp; |
| 3543 | } |
| 3544 | if (value == NULL) { |
| 3545 | exec->inputStack[exec->inputStackNr].value = NULL; |
| 3546 | } else { |
| 3547 | exec->inputStack[exec->inputStackNr].value = xmlStrdup(value); |
| 3548 | if (exec->inputStack[exec->inputStackNr].value == NULL) { |
| 3549 | exec->status = XML_REGEXP_OUT_OF_MEMORY; |
| 3550 | return; |
| 3551 | } |
| 3552 | } |
| 3553 | exec->inputStack[exec->inputStackNr].data = data; |
| 3554 | exec->inputStackNr++; |
| 3555 | exec->inputStack[exec->inputStackNr].value = NULL; |
| 3556 | exec->inputStack[exec->inputStackNr].data = NULL; |
| 3557 | } |
| 3558 | |
| 3559 | /** |
| 3560 | * xmlRegStrEqualWildcard: |
no test coverage detected