Hi Guys

I've had my 51 plate Audi s3 for a while. Engine management light has been on a few times and I have just had it turned off but keeps on coming back. The code that has come up is P0171 lean. is this the maf sensor? Would a clean be sufficient. I have just had a look and the plug and it has some visible damage on it i disconnected the plug and the inside plastic on the plug has been damage could this be causing the problem. I have removed the damaged sections and reconnected it. would be possible to change the connector for the loom?

Some ideas and advice please