The state House approved the measure 130-2 at 2 a.m., about 25 minutes after the Senate passed it 33-2, the Hartford Courant reported Wednesday.
An earlier version of the bill would have applied the measures only to the investigation into December's Newtown school massacre, but the final version blocking the release of photos, videos or digital video images "depicting the victim of a homicide, to the extent that such record could reasonably be expected to constitute an unwarranted invasion of the personal privacy" of the victim or surviving family members, the Courant reported.
The measure would not apply to audiotapes of 911 calls, which will continue to be disclosed as public records in accordance with the state's Freedom of Information Law. Such records are used by the public to evaluate police response to emergencies, the Courant reported.
The bill would have been voted on earlier, but 110 lawmakers wished to sign on as sponsors and it took time to list all of their names.
Malloy said his goal had been to "provide some measure of protection" for the families affected by the Sandy Hook Elementary School shooting in Newtown, but added "all families have a right to grieve in private."
"Just this morning people in the Legislature were moved to protect the memory of these children," the Waterbury Republican-American reported he said. "I, for one, believe that a parent of a deceased child should have the right to remember that child as they remember that child, not because that child was caught up in some tragic and unbelievable circumstances.
"So, our Legislature acted and, of course, I will act and sign that legislation so our parents, the parents that we have tried so diligently to support, will be able to remember their children just as they were the day they went to school."
Swim Week Miami Beach 2014 [PHOTOS]