Skip to content

Commit c4cb18a

Browse files
authored
Merge pull request #173 from milianw/fix-to_next_sibling-rc
Decrement refcount before calling free in to_next_sibling
2 parents 4bc8ba0 + 3294973 commit c4cb18a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cursor.rs

+2
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ impl SyntaxNode {
790790
Some(SyntaxNode { ptr })
791791
})
792792
.or_else(|| {
793+
data.dec_rc();
793794
unsafe { free(ptr) };
794795
None
795796
})
@@ -1234,6 +1235,7 @@ impl SyntaxElement {
12341235
}
12351236
})
12361237
.or_else(|| {
1238+
data.dec_rc();
12371239
unsafe { free(ptr) };
12381240
None
12391241
})

0 commit comments

Comments
 (0)