TS-1475 Memory leak. Coverity: 1226155