Skip to content

Commit

Permalink
Merge pull request #200 from thewtex/readfile-mem-leak
Browse files Browse the repository at this point in the history
Address buffer memory leak in readfile example
  • Loading branch information
PJK authored Feb 24, 2022
2 parents 3263254 + fe01fad commit 7b806bf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/readfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ int main(int argc, char* argv[]) {
/* Assuming `buffer` contains `length` bytes of input data */
struct cbor_load_result result;
cbor_item_t* item = cbor_load(buffer, length, &result);
free(buffer);

if (result.error.code != CBOR_ERR_NONE) {
printf(
Expand Down

0 comments on commit 7b806bf

Please sign in to comment.