projects
/
jansson.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0175951
)
add a safeguard against NULL return output stream
author
Sean Middleditch
<sean@middleditch.us>
Thu, 14 Jan 2010 02:33:19 +0000
(18:33 -0800)
committer
Sean Middleditch
<sean@middleditch.us>
Thu, 14 Jan 2010 02:33:19 +0000
(18:33 -0800)
janssonxx.h
patch
|
blob
|
history
diff --git
a/janssonxx.h
b/janssonxx.h
index
e09010d
..
57e2aed
100644
(file)
--- a/
janssonxx.h
+++ b/
janssonxx.h
@@
-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;
}