Added free after malloc