You can just malloc/new[] that in one go, right? Hoist it outside of the loop and do `ares_addr_node* nodes = new ares_addr_node[arr->Lenght()]`. Also makes cleaning up a single delete[] statement.