At present, when melbourne raise a syntax error, it has partially constructed a NODE* tree. The memory for this tree is managed by pt_allocate, which uses a simple memory pool mechanism to free the entire tree at the same time. This happens fine.
The problem is that the tree contains bstring's which need to have bdestroy() run on them or they leak memory. At present, bdestroy() is run when we run the visitors on the tree. But if a syntax error is cut, the tree is not processed and the bstring's are leak.
Possible solutions are to not use bstring at all within NODE* and instead build a simple string library that uses pt_allocate for allocations.
Some of us in the office think you should leave this leak as punishment to people who have syntax errors in their code.
Don't you have to, like, rescue the SyntaxError for this to matter? Won't that happen only in irb?
Fixing post 1.0