Skip to content

Commit

Permalink
Merge pull request #173 from James-ZHANG/missing-check-res
Browse files Browse the repository at this point in the history
add missing CHECK_RES calls
  • Loading branch information
PJK committed Dec 18, 2020
2 parents 9eae116 + db730c6 commit 5550925
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cbor/internal/builder_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ void cbor_builder_negint8_callback(void *context, uint8_t value) {
void cbor_builder_negint16_callback(void *context, uint16_t value) {
struct _cbor_decoder_context *ctx = context;
cbor_item_t *res = cbor_new_int16();
CHECK_RES(ctx, res);
cbor_mark_negint(res);
cbor_set_uint16(res, value);
_cbor_builder_append(res, ctx);
Expand Down Expand Up @@ -340,6 +341,7 @@ void cbor_builder_indef_break_callback(void *context) {
void cbor_builder_float2_callback(void *context, float value) {
struct _cbor_decoder_context *ctx = context;
cbor_item_t *res = cbor_new_float2();
CHECK_RES(ctx, res);
cbor_set_float2(res, value);
_cbor_builder_append(res, ctx);
}
Expand Down

0 comments on commit 5550925

Please sign in to comment.