Fix for write off end of allocated memory
Avoid invalid memory when GRES has no available plugin