Fix leak when generator return value is not used