fix memleak when call of convertFunc failes