Fix crash caused by attempting to free a const string.