alloc.c line 299
/* update first_free if needed */
if (map->first_free == start)
map->first_free += count;
Probable bug here - this is not always first free (it most likely works now because we do not free resources mid work yet) but if there was a realocation or any block was fited in a hole in memory this can result in first free beeing block which is already used.