`target_snap_points` could have size 0, but even so `memset(snap_data->target_snap_points, 0, sizeof(int));` was always called. Avoid writing to unallocated memory. And use C++ arrays.
`target_snap_points` could have size 0, but even so `memset(snap_data->target_snap_points, 0, sizeof(int));` was always called. Avoid writing to unallocated memory. And use C++ arrays.