calling free after malloc