Section 345 IPC primarily deals with wrongful confinement despite the issuance of a writ of liberation. However, its application may extend to other situations involving unlawful restraint.