Messi penalty ensures barcelona edge past real sociedad

I think there may be some confusion here!

Lionel Messi is a legendary footballer who has played for Barcelona for most of his career, but he has never played for Real Sociedad. Real Sociedad is a Spanish football club based in the Basque Country, and they have a long-standing rivalry with Athletic Bilbao, not Barcelona.

So, it's unlikely that Messi would have taken a penalty to ensure Barcelona edge past Real Sociedad, as he has never played for the latter club.

If you meant to ask about a different match or scenario, please feel free to clarify and I'll do my best to help!