One handgun which has gained quite a following lately for pocket carry is the little Polish P64, which is quite similar to the Walther PPK, although not quite an exact copy. As folks have gained experience with these little pocket-sized pistols a few issues have come to light.
These pistols have a decocker/safety. That is, when the safety is operated, it decocks the hammer and locks the firing pin (with one caveat, which I will discuss in detail below).
One thing that has been learned is that, if the hammer is decocked and the safety is off, if the hammer becomes snagged on something, maybe the lining of your pocket, such that the hammer is drawn partially back and then is released, the pistol can fire. Note that with the safety off the firing pin is no longer blocked, and the Poles omitted any sort of safety notch or half-cock notch on the hammer. Consequently you must always carry one of these pistols with the hammer decocked and the safety in the safe position.
The other thing that may cause an accidental discharge with one of these pistols is if the firing pin is not installed correctly in the slide. The firing pin has a lug, or tab, that should project horizontally out of the side of the firing pin. As the decocker is rotated into the decock position, a machined slot in the safety body envelopes the rear end of the firing pin and sort of grabs this tab. This is what locks the firing pin. It is possible to install the firing pin in the slide so that this lug, or tab, is pointing downwards instead of sideways as intended. In this situation, even if the safety is applied, the firing pin remains unlocked, and could contribute to an accidental discharge.
Note that there have been instances reported where the little safety lug is broken off of the firing, which renders the firing pin block inoperative on that particular pistol, regardless of the position of the safety.
It's a good idea to be familiar with the mechanics of your carry pistol and to inspect it for proper condition, or have a QUALIFIED gunsmith inspect it if you feel that you are not qualified or sufficiently knowledgeable. Also another reason to always point the pistol in a safe direction during loading or unloading, and always use a good holster.