Friedel-Crafts synthesis - How is HCl produced?
You could perform the electrophilic aromatic substitution with acetyl chloride as well instead of acetic anhydride - in the first case it is evident where $\ce{HCl}$ comes from. However, the mechanism is similar if you use acetic anhydride. The first step consists in the electrophile activation by $\ce{AlCl3}$, which generates in situ the "acylium" ion ($\ce{H3C-C#O+}$) - the actual acylating agent. The second step is the electrophilic aromatic substitution, in which the electrophile is preferentially "attacked" by the aromatic ring at the ortho- or para-position (ortho- and para-orienting effect of halides). The driving force for the reaction is the last step, which leads to restore the aromaticity and it is assisted by $\ce{(AcO)(Al)Cl2}$ with liberation of $\ce{HCl}$. 

Here I have drawn the mechanism: