Infestation of unidentified moth-like flying critters

If you can’t spare the freezer space for long term storage of cereals and such then the following is a good alternative, (but revolting if you think about it too much):

freeze the problematic food items for 4-7 days before storing in the pantry. This will murderize the undetectable larval guests.