TS-1475 Avoid leaking memory. Coverity: 1200016.