Fix recursion problem, remove branch around erealloc