diff options
Diffstat (limited to 'ext/psych/yaml/parser.c')
-rw-r--r-- | ext/psych/yaml/parser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/psych/yaml/parser.c b/ext/psych/yaml/parser.c index 32671b2..621f676 100644 --- a/ext/psych/yaml/parser.c +++ b/ext/psych/yaml/parser.c @@ -605,7 +605,7 @@ yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event, if (strcmp((char *)tag_directive->handle, (char *)tag_handle) == 0) { size_t prefix_len = strlen((char *)tag_directive->prefix); size_t suffix_len = strlen((char *)tag_suffix); - tag = yaml_malloc(prefix_len+suffix_len+1); + tag = YAML_MALLOC(prefix_len+suffix_len+1); if (!tag) { parser->error = YAML_MEMORY_ERROR; goto error; @@ -685,7 +685,7 @@ yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event, return 1; } else if (anchor || tag) { - yaml_char_t *value = yaml_malloc(1); + yaml_char_t *value = YAML_MALLOC(1); if (!value) { parser->error = YAML_MEMORY_ERROR; goto error; @@ -1208,7 +1208,7 @@ yaml_parser_process_empty_scalar(yaml_parser_t *parser, yaml_event_t *event, { yaml_char_t *value; - value = yaml_malloc(1); + value = YAML_MALLOC(1); if (!value) { parser->error = YAML_MEMORY_ERROR; return 0; @@ -1245,7 +1245,7 @@ yaml_parser_process_directives(yaml_parser_t *parser, } tag_directives = { NULL, NULL, NULL }; yaml_token_t *token; - if (!STACK_INIT(parser, tag_directives, INITIAL_STACK_SIZE)) + if (!STACK_INIT(parser, tag_directives, yaml_tag_directive_t*)) goto error; token = PEEK_TOKEN(parser); @@ -1266,7 +1266,7 @@ yaml_parser_process_directives(yaml_parser_t *parser, "found incompatible YAML document", token->start_mark); goto error; } - version_directive = yaml_malloc(sizeof(yaml_version_directive_t)); + version_directive = YAML_MALLOC_STATIC(yaml_version_directive_t); if (!version_directive) { parser->error = YAML_MEMORY_ERROR; goto error; |