heap: fix free function