mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-05-02 15:41:35 +02:00
Fix a border case which causes Value::CommentInfo::setComment() to crash
re: pull #140
This commit is contained in:
parent
dd91914b1b
commit
2f046b584d
@ -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] == '/',
|
||||
|
Loading…
x
Reference in New Issue
Block a user