ticket module: Fixed memleaks