Decomposition. Organisms that feed on the dead tree consume the sugars and O2 and make CO2.
Fungi, bugs, bacteria, etc. break down the tree. Some CO2 gets released during this process and then CO2 gets released when the bugs die and decompose. CO2 also gets released if the dead forest burns.