il_alloc: fix free memory function