diff options
author | Mathieu Duponchelle <mathieu.duponchelle@opencreed.com> | 2016-03-06 09:30:12 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-03-26 15:45:54 -0700 |
commit | 7dfe7fff11d7c22404db9f72c77bdb930267c634 (patch) | |
tree | 2bf1530a2cc9b43f7dee1fe84d56559a092cef55 | |
parent | 74c42c9eee645a4f65b19e74187876188f3e6a8a (diff) |
api_test: fix leak
Replaced nodes are not automatically freed.
-rw-r--r-- | api_test/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/api_test/main.c b/api_test/main.c index 4fa7896..8af2e71 100644 --- a/api_test/main.c +++ b/api_test/main.c @@ -362,6 +362,9 @@ static void create_tree(test_batch_runner *runner) { cmark_node *str4 = cmark_node_new(CMARK_NODE_TEXT); cmark_node_set_literal(str4, "brzz"); OK(runner, cmark_node_replace(str1, str4), "replace"); + // The replaced node is not freed + cmark_node_free(str1); + INT_EQ(runner, cmark_node_check(doc, NULL), 0, "replace consistent"); OK(runner, cmark_node_previous(emph) == str4, "replace works"); INT_EQ(runner, cmark_node_replace(p, str4), 0, "replace str for p fails"); |