Modified freeing of vertices and indices arrays

Set pointer and data pointer points to as NULL.