*: fix places where we were still using malloc/realloc