A well reported problem with the Apples MagSafe connectors, shorting within the cable due to repeated flexing at an acute angle near the connector and resulting breakdown of the insulating layer.
In my case, the insulation on the core conductor had broken down and begun to short to the outer ground shielding within 5mm of the MagSafe connector.
The connector itself is easy to take apart if you heat it first (heat gun or just a hairdryer will do).
I discarded the five centimetres of cable closest to the MagSafe connector, stripped the shielding back and re-soldered the two ground and single positive points. Adding two lengths of heat shrink tubing (a longer 3mm diameter piece with a shorter overlapping 5mm piece) to reduce future strain around the connector.
This MagSafe connector has been in regular use since late 2006, so it’s understandable that it might have been showing signs of wear and tear, but this is a common issue and one to keep a close eye on, I’m just glad I was at home when I saw this or I can well imagine it could have caught fire.