Skip to content

Commit

Permalink
kvlist: Handle referenced condition on teardown
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Aug 27, 2024
1 parent f10ae81 commit acd26e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cfl_kvlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,10 @@ void cfl_kvpair_destroy(struct cfl_kvpair *pair)
cfl_sds_destroy(pair->key);
}

if (pair->val != NULL) {
if (pair->val != NULL && !pair->val->referenced) {
cfl_variant_destroy(pair->val);
}

free(pair);
}
}

0 comments on commit acd26e3

Please sign in to comment.