Skip to content

Commit 242dfc5

Browse files
committed
Remember to duplicate string value when cloning
Signed-off-by: Casey Dahlin <[email protected]>
1 parent 586caf4 commit 242dfc5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/value.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ ason_clone_into(ason_t *target, ason_t *src)
515515
memcpy(target, src, sizeof(ason_t));
516516
target->refcount = refcount;
517517

518+
if (target->type == ASON_TYPE_STRING)
519+
target->string = xstrdup(src->string);
520+
518521
if (! target->count) {
519522
ason_destroy(src);
520523
return;

0 commit comments

Comments
 (0)