Rizwan and Irfan both suffered hamstring injuries in the third match in Rawalpindi
Barca's all-time top scorer calmly chipped the ball into the net in the 81st minute after Sociedad defender Robin Le Normand was penalised following a VAR review for hitting the ball with his arm as he contested a cross.
The penalty was awarded at a time when Barca were struggling to cope with Sociedad's flowing counterattacks, with the Basques missing several chances to take the lead at the Camp Nou in a bold second-half display.
The victory took Barca back to the top of the standings on 58 points after 27 games although Real Madrid, on 56, can restore their place at the league's summit by beating Real Betis on Sunday.