Have you ever opened an old bag of flour, old box of Jiffy cornbread mix, old pancake mix, old oatmeal, etc, and found bugs or golden colored bug skins? It's because all grain products have weevil eggs. If you put it in the freezer for a minimum of 48 hrs it will keep alot of the eggs from hatching. Store it in there full time and none of 'em will hatch. Heloise recommends 7 days in freezer.
My grandma always said 2 days minimum, but she herself kept things like flour in the freezer full time. I had some flour I put in the freezer for a few days and then put the flour in glass containers with rubber seals. I moved and those containers ended up in a box that didnt get unpacked for several years. When it was finally unpacked, no sign of bugs.
And, of course, make sure to buy fresh product by checking the sell by date or packing date.
If you should get a weevil infestation, heloise recommends (from http://www.homeabc.net/Other/370-2-other.html
throw away all of the grain products that are infested with the weevils. This can include pasta, rice, cornmeal, flour, spices and even dry dog food.
Next, take everything out of your pantry and wash down the shelves with hot, soapy water. Then spray the shelves with an insecticide that will kill weevils (it will say so on the label) and be sure to follow the label directions exactly.
You can also end up bringing home a box that's got the bugs hatched out already, even with a good sell-by date. That's happened to me
That is usually caused by the warehouse having a weevil problem or the grocery store having a weevil problem.