From 9c7ba2508ded88b1f9f824775a50474ded220656 Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Tue, 10 Nov 2015 16:49:30 -0200 Subject: [PATCH] modules/json: check for buffer errors on serialize function Signed-off-by: Bruno Dilly --- src/modules/flow/json/json.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/flow/json/json.c b/src/modules/flow/json/json.c index 51d32a9a6..4d82ecb72 100644 --- a/src/modules/flow/json/json.c +++ b/src/modules/flow/json/json.c @@ -973,8 +973,10 @@ json_serialize(struct sol_buffer *buffer, struct json_element *element) SOL_INT_CHECK(r, < 0, r); SOL_VECTOR_FOREACH_IDX (&element->children, key_element, i) { - if (i > 0) + if (i > 0) { r = sol_buffer_append_char(buffer, ','); + SOL_INT_CHECK(r, < 0, r); + } r = json_serialize_key_element(buffer, key_element); SOL_INT_CHECK(r, < 0, r); }