He helped River Song to deadlock seal the baggage hold containing the TARDIS (and the body of Hydroflax), leaving her and the Twelfth Doctor free to visit the restaurant and sell the Halassi Androvar lodged in Hydroflax's brain. Unfortunately, using Ramone's head, Hydroflax's body was able to trick Flemming into opening the hold and faced with the prospect of losing his own head, Flemming made a bargain with the body of the king. If the cyborg were to spare his life, Flemming would tell him all he knew about the real husband of River Song and help him to track the head of the the Doctor.
Having betrayed River, Flemming led Hydroflax's body to her and stole her diary hoping to use it to his advantage, even reading out portions of it in a taunting manner. However, River hadn't chosen this starship on this particular date for no reason, and had timed her arrival perfectly. With the foreknowledge of an approaching meteor and the kind of damage it would have done to the onboard restaurant, she was able to manoeuvre herself onto a portion of floor that would collapse into the corridor below, enabling herself and the Twelfth Doctor to escape Flemming and the others without harm.
Flemming did not survive his encounter with River and the Doctor, and was killed either directly by the meteor hit, or by the Harmony and Redemption subsequently crash-landing on the planet Darillium. 400 years later, a younger River found his remains. (TV: The Husbands of River Song)