If photo one was exectly the situation when you charged the battery, then it's your fault, not charger problem. If you put the charger on top of the power cord, then the heat generated from the charger would possibily burned the plastic shield and caused fire and smoke, especially if you are using the stock cable (usually poor quality) came with the charger. Your photo showed the charger didn't burned, only the cable did.
So if any ching buy similar grade charger, 1st thing to do is to change to better quality cables (both power cable and battery cable), and do not put charger on top of cable for charging !