Freezing in charged porous media can induce significant pressure and cause damage to tissues and functional materials. We formulate a thermodynamically consistent theory to model freezing phenomena inside charged heterogeneous porous space. Two regimes are distinguished: free ions in open pore space lead to negligible effects of freezing point depression and pressure. On the other hand, if nano-fluidic salt trapping happens, subsequent ice formation is suppressed due to the high concentration of ions in the electrolyte. In this case, our theory predicts that freezing starts at a significantly lower temperature compared to pure water. In 1D, as the temperature goes even lower, ice continuously grows, until the salt concentration reaches saturation, all ions precipitate to form salt crystals, and freezing completes. Enormous pressure can be generated if initial salt concentration is high before salt entrapment. We show modifications to the classical nucleation theory, due to the trapped salt ions. Interestingly, although the freezing process is enormously changed by trapped salts, our analysis shows that the Gibbs-Thompson equation on confined melting point shift is not affected by the presence of the electrolyte.