fix covarity defects