I hate to say it, but even if you put (non-frozen) grain-type stuff in jars, you can still get bugs in your food because the eggs are likely in there.
The jar method WILL keep them contained so they don't infest your house though!
And if you freeze your grains for a few days after you purchase them, THEN jar them, you'll probably not get the moth problem because yes, freezing does kill the eggs.
I need to follow my own advice and not forget/get careless again.