This work presents a numerical study dedicated to the formation of unburnt hydrocarbon. Two configurations: head-on quenching (HOQ) on a planar wall and in crevices, are considered. It is well known that they contribute for an important part to the sources of hydrocarbon (HC) emission in a combustion chamber. The aim of this work is to use laminar flame simulations (LFS) to understand how the unburnt HC are produced near walls in gasoline engine. A skeletal mechanism (29 species and 48 reactions) mimicking iso-octane combustion is used. In the HOQ configuration, the flame front propagates toward the cold wall where quenching occurs. The numerical procedure and the chemical scheme used in this study are first validated by comparisons with literature results for the 1D case. Several aspects of flame wall quenching such as oxidation of unburnt HC, wall heat flux, quench distances as well as HC families are investigated by varying parameters like wall temperature and equivalence ratio. In a second part, crevices are considered to study the impact of wall imperfections in combustion chambers. Configurations with different geometrical and thermodynamic properties are tested. It leads to a wide range of flame properties and HC production modes. When incomplete combustion occurs, total HC (fuel + HC) concentration can reach very high levels at the wall. When the crevice is not wide enough, the flame cannot propagate and the quantity of HC is smaller than in the case where the flame can propagate (but the fuel is not oxidizing). If the crevice is wide enough for the flame to propagate, HOQ occurs at 1 the bottom of the crevice and HC accumulate in the corners. The computational results obtained in this work demonstrate the ability of LFS to reproduce incomplete combustion mechanisms that are responsible for a major part of HC production in gasoline engines.