Fixed memory leak in batch allocator.