aboutsummaryrefslogtreecommitdiff
path: root/src/XpathParser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XpathParser.c')
-rw-r--r--src/XpathParser.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/XpathParser.c b/src/XpathParser.c
index 4326e85..0dbe270 100644
--- a/src/XpathParser.c
+++ b/src/XpathParser.c
@@ -19,7 +19,7 @@ static int xpath_parse_param(QuickMediaXpathParser *self, QuickMediaNodeSearchPa
if(token != QUICKMEDIA_XPATH_TOKEN_IDENTIFIER)
return -1;
- result->name = quickmedia_xpath_tokenizer_copy_identifier(&self->tokenizer);
+ result->name = self->tokenizer.identifier;
token = quickmedia_xpath_tokenizer_next(&self->tokenizer);
if(token != QUICKMEDIA_XPATH_TOKEN_EQUAL)
@@ -29,7 +29,7 @@ static int xpath_parse_param(QuickMediaXpathParser *self, QuickMediaNodeSearchPa
if(token != QUICKMEDIA_XPATH_TOKEN_STRING)
return -3;
- result->value = quickmedia_xpath_tokenizer_copy_string(&self->tokenizer);
+ result->value = self->tokenizer.string;
token = quickmedia_xpath_tokenizer_next(&self->tokenizer);
if(token != QUICKMEDIA_XPATH_TOKEN_CLOSING_BRACKET)
@@ -50,23 +50,22 @@ static int xpath_parse_node(QuickMediaXpathParser *self, QuickMediaNodeSearch *r
if(token != QUICKMEDIA_XPATH_TOKEN_IDENTIFIER)
return -1;
- result->name = quickmedia_xpath_tokenizer_copy_identifier(&self->tokenizer);
+ result->name = self->tokenizer.identifier;
int param_result = xpath_parse_param(self, &result->param);
- if(param_result < 0) {
- quickmedia_node_search_deinit(result);
+ if(param_result < 0)
return param_result;
- }
result->child = malloc(sizeof(QuickMediaNodeSearch));
+ if(!result->child)
+ return -1;
+
int node_result = xpath_parse_node(self, result->child);
if(node_result > 0) {
node_result = 0;
/* Didn't have child, remove child */
free(result->child);
result->child = NULL;
- } else if(node_result < 0) {
- quickmedia_node_search_deinit(result);
}
return node_result;