fix: better memory management ( Z_Free() instead of free() )

Signed-off-by: Stephen L. <lrq3000@gmail.com>