Merge pull request #141 from cdunn2001/set-comment

Fix a border case which causes Value::CommentInfo::setComment() to crash
This commit is contained in:
Christopher Dunn 2015-01-25 11:37:02 -06:00
commit 7312b1022d

View File

@ -142,8 +142,10 @@ Value::CommentInfo::~CommentInfo() {
}
void Value::CommentInfo::setComment(const char* text) {
if (comment_)
if (comment_) {
releaseStringValue(comment_);
comment_ = 0;
}
JSON_ASSERT(text != 0);
JSON_ASSERT_MESSAGE(
text[0] == '\0' || text[0] == '/',