Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix reference counter falling belowing zero
This commit fixes an issue where a node's reference counter may fall below zero when more than one tree share the same node (rc == 1) and then the both copy the node and fetch_subtract the rc. This is a hard to produce issue, but possible. The rc must never fall below zero except when the node is about to be freed by the node_free function. This commit replaces the fetch_subtract with node_free which correctly frees the node when the rc == -1.
- Loading branch information