[#1376] fix memory leak