From time to time i got questions about the safety of the styrofoam insulation around my old fridge. Indeed there were incidents of burning styrofoam insulated walls of buildings. Here they caused great troubles because they were dropping liquid burning pieces and became impossible to cross.
However styrofoam at an old fridge is different cause nobody needs to cross it in the case of fire. Styrofoam itself is not prone to take fire. It needs at least 350°C to make it burn. Of course burning styrofoam does produce toxic gases as does other materials too - even wood does. That means in case of a fire in your flat too big to extinct immediately you should leave your flat alone. Even if you have to leave behind your nice insulate-your-refrigerator-project ;)
Of course when insulating your old fridge you should use your common sense and leave all elelctric devices uncovered. You will find more details here: Insulate your fridge yourself