[PATCH 5.9 405/757] refperf: Avoid null pointer dereference when buf fails to allocate