plugins types BUGFIX empty dynamic value leak
diff --git a/src/plugins_types.c b/src/plugins_types.c
index 0bb68fc..ca8624d 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -1311,7 +1311,7 @@
  */
 static LY_ERR
 ly_type_store_empty(const struct ly_ctx *ctx, const struct lysc_type *type, const char *value, size_t value_len,
-        uint32_t UNUSED(options), LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), uint32_t hints,
+        uint32_t options, LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), uint32_t hints,
         const struct lysc_node *UNUSED(ctx_node), struct lyd_value *storage, struct ly_err_item **err)
 {
     /* check hints */
@@ -1328,7 +1328,11 @@
         }
     }
 
-    LY_CHECK_RET(lydict_insert(ctx, "", 0, &storage->canonical));
+    if (options & LY_TYPE_STORE_DYNAMIC) {
+        LY_CHECK_RET(lydict_insert_zc(ctx, (char *)value, &storage->canonical));
+    } else {
+        LY_CHECK_RET(lydict_insert(ctx, value, value_len, &storage->canonical));
+    }
     storage->ptr = NULL;
     storage->realtype = type;