Skip to content

Commit 68e98ee

Browse files
committed
fix metadatacopy to actually copy the payload and not reference it
1 parent bf4c10a commit 68e98ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

format/metadatacopy.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ func (format *MetadataCopy) Configure(conf core.PluginConfigReader) {
6666
func (format *MetadataCopy) ApplyFormatter(msg *core.Message) error {
6767
meta := msg.GetMetadata()
6868
data := format.GetAppliedContent(msg)
69+
pool := core.MessageDataPool
70+
6971
for _, key := range format.metaDataKeys {
70-
meta.SetValue(key, data)
72+
bufferCopy := pool.Get(len(data))
73+
copy(bufferCopy, data)
74+
meta.SetValue(key, bufferCopy)
7175
}
7276
return nil
7377
}

0 commit comments

Comments
 (0)