FIXME: realloc(): invalid size in heap_insert(...)