* xmlXPathNewCompExpr: * * Create a new Xpath component * * Returns the newly allocated xmlXPathCompExprPtr or NULL in case of error */
| 886 | * Returns the newly allocated xmlXPathCompExprPtr or NULL in case of error |
| 887 | */ |
| 888 | static xmlXPathCompExprPtr |
| 889 | xmlXPathNewCompExpr(void) { |
| 890 | xmlXPathCompExprPtr cur; |
| 891 | |
| 892 | cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr)); |
| 893 | if (cur == NULL) |
| 894 | return(NULL); |
| 895 | memset(cur, 0, sizeof(xmlXPathCompExpr)); |
| 896 | cur->maxStep = 10; |
| 897 | cur->nbStep = 0; |
| 898 | cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep * |
| 899 | sizeof(xmlXPathStepOp)); |
| 900 | if (cur->steps == NULL) { |
| 901 | xmlFree(cur); |
| 902 | return(NULL); |
| 903 | } |
| 904 | memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp)); |
| 905 | cur->last = -1; |
| 906 | return(cur); |
| 907 | } |
| 908 | |
| 909 | /** |
| 910 | * xmlXPathFreeCompExpr: |
no outgoing calls
no test coverage detected