fix memory leak in compute omega/chunk
(cherry picked from commit e8d0342503708501b849dbd7e1c81143cac47258)