diff options
author | Kirill Simonov <xi@resolvent.net> | 2006-07-21 18:29:00 +0000 |
---|---|---|
committer | Kirill Simonov <xi@resolvent.net> | 2006-07-21 18:29:00 +0000 |
commit | 54815ffd349279576102da76745f482b5ba5a236 (patch) | |
tree | fa00f8830ce3f385a2634136a9b4d191cd772873 /src/parser.c | |
parent | 625fcfe9edfbe8576ec6ef8d2d6adaed4bb86403 (diff) | |
download | libyaml-git-54815ffd349279576102da76745f482b5ba5a236.tar.gz |
Fix some leaks, segfaults and warnings.
Diffstat (limited to 'src/parser.c')
-rw-r--r-- | src/parser.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c index fe9e171..2b81b0c 100644 --- a/src/parser.c +++ b/src/parser.c @@ -363,6 +363,8 @@ yaml_parser_state_machine(yaml_parser_t *parser, yaml_event_t *event) default: assert(1); /* Invalid state. */ } + + return 0; } /* @@ -1358,12 +1360,16 @@ yaml_parser_process_directives(yaml_parser_t *parser, if (tag_directives_start_ref) { if (STACK_EMPTY(parser, tag_directives)) { *tag_directives_start_ref = *tag_directives_end_ref = NULL; + STACK_DEL(parser, tag_directives); } else { *tag_directives_start_ref = tag_directives.start; - *tag_directives_end_ref = tag_directives.end; + *tag_directives_end_ref = tag_directives.top; } } + else { + STACK_DEL(parser, tag_directives); + } return 1; @@ -1384,7 +1390,6 @@ yaml_parser_append_tag_directive(yaml_parser_t *parser, { yaml_tag_directive_t *tag_directive; yaml_tag_directive_t copy = { NULL, NULL }; - int length; for (tag_directive = parser->tag_directives.start; tag_directive != parser->tag_directives.top; tag_directive ++) { |