Fix memleak spoted by COV