[FOLD] Fix leak in SOTemplate