udoprog/c10t — Issue #251: Segfault on freeing nbt-stack-entry
Author: UniversE
Created: 2012-02-24 19:01:56+00:00
State: open

I don't know what happend to my map yesterday but something happend that causes a segfault at the line where the "delete [] stack;" statement is. Unfortunately I'm developing c10t directly on the server, because I don't run a linux here (Solaris ftw. btw. ;) so I cant check with a profiler for a double-free here, but this is what I suspect.

File: nbt/nbt.hpp

```c++
void parse(input_buffer_ptr file)
{
running = true;
stack_entry *stack = new stack_entry[NBT_STACK_SIZE];
int stack_p = 0;
stack_entry *root = stack + 0;

if (setjmp(exc_env) == 1) {
delete [] stack;
return;
}
```

I'm investigating this now.