add a safeguard against NULL return output stream
This commit is contained in:
parent
01759517aa
commit
5a0efe6536
@ -265,8 +265,10 @@ private:
|
||||
// stream JSON value out
|
||||
std::ostream& operator<<(std::ostream& os, const jansson::Value& value) {
|
||||
char* tmp = value.save_string();
|
||||
os << tmp;
|
||||
free(tmp);
|
||||
if (tmp != 0) {
|
||||
os << tmp;
|
||||
free(tmp);
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user