You are probably already familiar with the story of James Spratt's injuries incurred when boarding L'Aigle during the Battle of Trafalgar. His right leg was shattered below the knee, but he refused amputation, eventually recovered, and returned to the service with it 3 inches shorter than the left.
Quote:
On arriving at Gibraltar the pain Mr. Spratt endured was so acute that it brought on a fever, during the paroxysms of which the settings of his leg became deranged as fast as the surgeon could dress them. To obviate the inconvenience and danger arising from this it was resolved to encase the limb in a long box adapted to the purpose, and to allow It to remain in that state for nine days in order to facilitate the formation of callus. Long before the time prescribed had elapsed Mr. Spratt’s sufferings were greatly, increased by a gnawing, unaccountable sensation, not attributable to the nature of his ailment. On the box being at length unlocked, a spectacle presented itself to the view of the medical officers present unparalleled in the history of their experience. Hundreds of maggots, an inch long, were stuck into the calf, with only the tips of their tails to be seen, the remainder of their bodies being embedded in the flesh. How to get rid of this astounding production was now the question. One of the surgeons essayed the effect of his forceps, but no sooner was the instrument applied than the creatures broke short off. A second doctor, however, more ingenious, ran to his medicine chest, and returned with a phial, the contents of which had the desired effect. This, the first case of the kind that occurred in the hospital, was accounted for by some of the numerous parasitical flies attracted there after the battle of Trafalgar having deposited their eggs in the wound.
Source: O'Byrne
I dare say the maggots saved his life by cleaning any infection from the wound.