[#1472] memleak fix