Since the outbreak of COVID-19 in 2019, the accumulation of related medicines has led to the disposal of waste medicines, while current disposal of medicines waste huge resources and increases carbon emissions as well. The oil field is a special closed-loop system, where the produced water is internally recycled after water treatment without any discharge. Therefore, oilfield water treatment provides an environment where waste medicines do not interact with the biosphere. In this study, hydroxychloroquine sulfate (HCQS) tablets were used as a fungicide and corrosion inhibitor in oilfield water treatment. The weight loss experiment showed that HCQS exhibit high corrosion inhibition efficiency under acidic conditions. And the corrosion inhibition rate decreases with the increase of temperature. At 333 K, with the concentration of 200 mg/L, the corrosion inhibition rate of HCQS reaches the maximum of 90.86%. The adsorption of HCQS on the surface of low carbon steel conforms to the Langmuir adsorption isotherm and belongs to physical adsorption. The thermodynamic simulation indicates that the adsorption of HCQS on steel surface is an exothermic, spontaneous and entropy reduction process. The electrochemical test results show that HCQS is a mixed inhibitor to the anodic reaction. In addition, the bactericidal effect of HCQS was evaluated, and it was found that when the concentration was 1000 mg/L, the bactericidal rate of HCQS to three kinds of oilfield microorganisms was more than 95%. Finally, the cost-benefit analysis was conducted to discuuse the application feasibility. This simple and effective method can be provided to enable resourceful disposal of waste medicines.