diff --git a/zapjournald.go b/zapjournald.go index 1fbec86..208fa97 100644 --- a/zapjournald.go +++ b/zapjournald.go @@ -75,6 +75,7 @@ func (core *Core) Write(entry zapcore.Entry, fields []zapcore.Field) error { if err != nil { return fmt.Errorf("failed to encode log entry: %w", err) } + defer buffer.Free() message := buffer.String()