Skip to content

Commit

Permalink
variant: return NULL on allocation exception (CID 507937)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Aug 26, 2024
1 parent 5a0884c commit 7ff27c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cfl_variant.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct cfl_variant *cfl_variant_create_from_bytes(char *value, size_t length, in
instance->data.as_bytes = cfl_sds_create_len(value, length);
if (instance->data.as_bytes == NULL) {
free(instance);
instance = NULL;
return NULL;
}
}
cfl_variant_size_set(instance, length);
Expand Down

0 comments on commit 7ff27c1

Please sign in to comment.