free_bodies(VarLenData **bodies, int len)
{
    while (len--)
    {
        XFREE(bodies[len]->data);
        XFREE(bodies[len]);
    }
}

The product reads data past the end, or before the beginning, of the intended buffer.