Lint: if realloc fails, the memory has been freed, don't free it twice.