Alexander Wiederhold, 30, of Frackville PA, was charged with child endangerment since he was walking with a 6-year-old at the time the gun went off in his waistband, Wildwood Crest police said.
He was carrying bags to his motel room when the accident occurred, but did not have a concealed cary permit, police said.
The incident occurred at about 4:15 p.m. on Tuesday, May 23.
Wiederhold was with a 29-year-old woman, Sabrina Sweed, and the child, neither of whom were struck, police said.
The handgun was registered to Sweed, who was charged with possession of a high-capacity magazine and possession of hollow point bullets.
Wiederhold also was charged with multiple weapons offenses, police said.
Wiederhold was taken to an area hospital for treatment.
He was later taken to the Cape May County jail.
The motel was not identified by police.
Click here to follow Daily Voice Villas-Lower Township and receive free news updates.