lib: fix memory leak in rope_insert
Found that in case of exiting the rope_insert function with an error some nodes are created but not deleted. This commit fixes it and adds the test. Test checks that in case of this error the number of allocated nodes and the number of freed nodes are the same. Closes #5788
Showing
- src/lib/salad/rope.h 4 additions, 2 deletionssrc/lib/salad/rope.h
- test/unit/CMakeLists.txt 2 additions, 0 deletionstest/unit/CMakeLists.txt
- test/unit/gh-5788-rope-insert-oom.c 87 additions, 0 deletionstest/unit/gh-5788-rope-insert-oom.c
- test/unit/gh-5788-rope-insert-oom.result 23 additions, 0 deletionstest/unit/gh-5788-rope-insert-oom.result
test/unit/gh-5788-rope-insert-oom.c
0 → 100644
test/unit/gh-5788-rope-insert-oom.result
0 → 100644
Please register or sign in to comment