test: fix global mem leak error