remove unnecessary mallocs from test