Ouch! While holstering his pistol, this officer trainee somehow pulled the trigger. Notice that the article just says 'the gun went off'. This was not the gun's fault. Maybe it caught on the holster. Maybe he had his finger in the trigger. I expect the trainer is catching significant hell about this. James Rummel, Say Uncle, Les Jones, how does one properly holster a weapon?
Update: Marc explains how to properly holster a weapon. Thanks, Marc! (Kevin Baker, Marc and James Rummel also comment below.) Here's another article with more information on the incident. The weapon was a .40 caliber Glock, and this article correctly identifies the problem as human error. By the way, the police were training at The Bullet Hole, the range where my wife and I are members.