[PATCH 3/6] reg: Use free() instead of heap_free()