Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions toml_parse.rl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct toml_stack_item {
struct toml_stack_item* context = CONTEXT(&context_stack); \
list_del(&context->list); \
x = context->node; \
free(context); \
} while (0)

static size_t
Expand Down Expand Up @@ -301,6 +302,7 @@ add_node_to_tree(struct list_head* context_stack, struct toml_node* node, char*

context->list_type = TOML_LIST;
item->node.type = TOML_LIST;
item->node.name = NULL;
if (name)
{
item->node.name = name;
Expand Down Expand Up @@ -769,6 +771,10 @@ toml_parse(struct toml_node* toml_root, char* buf, int buflen)

%% write exec;

while ((root = CONTEXT(&context_stack))) {
POP_CONTEXT(toml_root);
}

if (malloc_error) {
fprintf(stderr, "malloc failed, line %d\n", cur_line);
return 1;
Expand Down