Skip to content

Commit

Permalink
decode: adjust NULL check
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski committed Oct 18, 2023
1 parent 77b4c9d commit 5bd68b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmt_decode_msgpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,11 +977,11 @@ static int unpack_basic_type_meta(mpack_reader_t *reader, size_t index, void *co
result = cmt_mpack_unpack_map(reader, callbacks, context);

if (CMT_DECODE_MSGPACK_SUCCESS == result) {
decode_context->map->label_count = cfl_list_size(&decode_context->map->label_keys);
if (decode_context->map == NULL || decode_context->map->parent == NULL) {
return CMT_DECODE_MSGPACK_INVALID_ARGUMENT_ERROR;
}

decode_context->map->label_count = cfl_list_size(&decode_context->map->label_keys);
if (decode_context->map->type == CMT_HISTOGRAM) {
histogram = (struct cmt_histogram *) decode_context->map->parent;

Expand Down

0 comments on commit 5bd68b7

Please sign in to comment.