Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
modules/json: check for buffer errors on serialize function
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Dilly <bruno.dilly@intel.com>
  • Loading branch information
bdilly committed Nov 10, 2015
1 parent fbefd62 commit 9c7ba25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/flow/json/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9c7ba25

Please sign in to comment.