summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-05-21 16:24:39 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-05-21 16:24:39 -0400
commit4b1615c76b5b4fe110eb01392c98eddaf03bb103 (patch)
tree2f6be10fe3bca7f630a503c2a4618244cef932fd /src
parent73595d127a0cfc9b36e8e9489fdcbd35de051c38 (diff)
pke: component serialization alloc string via val
Diffstat (limited to 'src')
-rw-r--r--src/serialization-component.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/serialization-component.cpp b/src/serialization-component.cpp
index 4f65a5a..63e7a5c 100644
--- a/src/serialization-component.cpp
+++ b/src/serialization-component.cpp
@@ -163,7 +163,8 @@ pk_handle pke_serialize_instance(srlztn_serialize_helper *h, const CompInstance
}
if (et != nullptr) {
kve.key = SRLZTN_INSTANCE_COMPONENT_ENTITY_TYPE_CODE;
- s = pk_new<char>(et->entityTypeCode.reserved, h->bkt);
+ len = strlen(et->entityTypeCode.val);
+ s = pk_new<char>(len+1, h->bkt);
sprintf(s, "%s", et->entityTypeCode.val);
kve.val = s;
kve.end = SRLZTN_KVE_END;