replaced some more malloc/free usage with global_alloc_array/global_free_array (nw)