There is a call to rec_get_offsets() that may invoke mem_heap_create(), but there is no call to mem_heap_free(heap).
This should be reproducible with:
Simple fix: Add
Better fix: Remove this kind of use of rec_get_offsets(), and implement a record field iterator that can be used for computing the size of a record. There is no need to compute any offsets except when some algorithm requires random access to the fields of an index record.