summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plist.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plist.c b/src/plist.c
index c205d46..8c326af 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -148,6 +148,19 @@ static void plist_copy_node(GNode * node, gpointer parent_node_ptr)
assert(data); // plist should always have data
memcpy(newdata, data, sizeof(struct plist_data_s));
+
+ plist_type node_type = plist_get_node_type(node);
+ if (node_type == PLIST_DATA || node_type == PLIST_STRING) {
+ switch (node_type) {
+ case PLIST_DATA:
+ newdata->buff = (uint8_t *) malloc(data->length);
+ memcpy(newdata->buff, data->buff, data->length);
+ case PLIST_STRING:
+ newdata->strval = strdup((char *) data->strval);
+ default:
+ break;
+ }
+ }
newnode = plist_new_node(newdata);
if (*(plist_t*)parent_node_ptr) {