Cleaning a blackpowder gun after firing it is an extensive process that usually involves a lot of water. How would soldiers clean them give their relatively limited resources in the field?
Same way we clean black powder arms today. With much grumbling and cussing while mucking about with hot water, cleaning tools and oils.
First, I want to clear a misconception. The powder or primer residue isn't corroded. It's hydroscopic, which is to say it attracts and holds moisture.
As an example, during the civil war, each soldier was issued a basic cleaning kit, including a worm and jag. Brushes and lubricating oils would generally be kept at a small unit level for everyone to use. Various manuals of arms detail cleaning requirements using hot water and much scrubbing. Later on with the advent of cartridge arms and corrosive primers, cleaning fluid containing ammonia, which neutralizes the hydroscopic salts would be issued.
Cleaning your weapon between combat sessions would be important to clear powder and lead fouling and ensure proper function of the gun. It just doesn't show up in most accounts, anymore than describing in detail the saddling of a horse or tying of shoes.