diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-09-26 11:27:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-26 11:27:14 +0200 |
commit | e1f89c6141d4ed487d0b98198655ce7d7dcfd79a (patch) | |
tree | 5ab474a9c31ffa8df8e09392a6bd1f8aee9b3f56 /src | |
parent | aa558b2bc2e88437f8ccb95318c648fe32ece762 (diff) | |
parent | 2bac4575c69ef7aba8da9e2f15af4c95644b3556 (diff) |
Merge pull request #157 from kivikakk/list-parse-mem-leak
Fix memory leak in list parsing
Diffstat (limited to 'src')
-rw-r--r-- | src/blocks.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blocks.c b/src/blocks.c index bfd64d8..3c21fbf 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -933,10 +933,10 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container, *container = add_child(parser, *container, CMARK_NODE_THEMATIC_BREAK, parser->first_nonspace + 1); S_advance_offset(parser, input, input->len - 1 - parser->offset, false); - } else if ((matched = parse_list_marker( + } else if ((!indented || cont_type == CMARK_NODE_LIST) && + (matched = parse_list_marker( parser->mem, input, parser->first_nonspace, - (*container)->type == CMARK_NODE_PARAGRAPH, &data)) && - (!indented || cont_type == CMARK_NODE_LIST)) { + (*container)->type == CMARK_NODE_PARAGRAPH, &data))) { // Note that we can have new list items starting with >= 4 // spaces indent, as long as the list container is still open. |