replace malloc/free with fzalloc/fzfree