parser: fix realloc issue

Fix reallocation issue introduced in last merge