--- var.c 2001/11/16 16:01:20 1.20
+++ var.c 2001/11/19 14:10:48 1.21
@@ -1512,6 +1512,7 @@
void *lookup_context, int force_expand,
tokenbuf_t *output)
{
+ const char* p = begin;
int rc;
tokenbuf_t result;
@@ -1550,7 +1551,11 @@
return VAR_OK;
error_return:
+ tokenbuf_free(output);
tokenbuf_free(&result);
+ output->begin = p;
+ output->end = begin;
+ output->buffer_size = 0;
return rc;
}
@@ -1587,13 +1592,9 @@
/* Call the parser. */
tokenbuf_init(&output);
- if ((rc = input(input_buf, input_buf + input_len, config, nameclass,
- lookup, lookup_context, force_expand, &output)) != VAR_OK) {
- tokenbuf_free(&output);
- return rc;
- }
+ rc = input(input_buf, input_buf + input_len, config, nameclass,
+ lookup, lookup_context, force_expand, &output);
*result = (char *)output.begin;
*result_len = output.end - output.begin;
-
- return VAR_OK;
+ return rc;
}
|