The mall-cop comedy you're thinking of is almost certainly Paul Blart: Mall Cop (2009), starring Kevin James as the titular security guard who takes his job very seriously—and ends up single-handedly thwarting a heist on Black Friday. The film spawned a 2015 sequel (Paul Blart: Mall Cop 2) and cemented James's transition from King of Queens TV star to leading-man status.