Moved free(user_name); before setting home_dir.