You will be responsible for the whole contract unless someone claims him while on waivers. If the player clears waivers and is picked up, the signing team only has to pay the prorated league minimum the rest of this season. You are on the hook for the rest.
Your only hope is to trade him or have someone pick him up off waivers.