projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a359afe
)
src/utils_format_json.c: Check return value of json_escape_string().
author
Florian Forster
<octo@collectd.org>
Tue, 8 Dec 2015 10:30:38 +0000
(11:30 +0100)
committer
Florian Forster
<octo@collectd.org>
Tue, 8 Dec 2015 10:34:00 +0000
(11:34 +0100)
CID: 37946
src/utils_format_json.c
patch
|
blob
|
history
diff --git
a/src/utils_format_json.c
b/src/utils_format_json.c
index
23a0fdf
..
020d80b
100644
(file)
--- a/
src/utils_format_json.c
+++ b/
src/utils_format_json.c
@@
-262,8
+262,12
@@
static int meta_data_keys_to_json (char *buffer, size_t buffer_size, /* {{{ */
if (meta_data_get_string (meta, key, &value) == 0)
{
char temp[512] = "";
- json_escape_string (temp, sizeof (temp), value);
+
+ status = json_escape_string (temp, sizeof (temp), value);
sfree (value);
+ if (status != 0)
+ return status;
+
BUFFER_ADD (",\"%s\":%s", key, temp);
}
}