Hernandez had arrived at Leicester from Sporting Gijon on a free transfer, but failed to care out a spot on Claudio Ranieri's team.
The 27-year-old defender played just eight times for Leicester with his last apperance on 13 December.
Hernandez has penned a three-and-a-half-year deal with Malaga, who are sitting in 14th place in the Spanish La Liga.