[TIMOB-12364] Fixed a memory leak