summaryrefslogtreecommitdiff
path: root/src/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/node.c b/src/node.c
index 0fd5573..ee1d6c3 100644
--- a/src/node.c
+++ b/src/node.c
@@ -734,8 +734,7 @@ int cmark_node_replace(cmark_node *oldnode, cmark_node *newnode) {
if (!cmark_node_insert_before(oldnode, newnode)) {
return 0;
}
- cmark_node_unlink(oldnode);
- cmark_node_free(oldnode);
+ cmark_node_free(oldnode); // free calls cmark_node_unlink
return 1;
}