Rich D: fixed misuse of realloc