From 0c7ee22452daab1bad287a13ab5406c62b25c65a Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Wed, 27 Mar 2024 21:09:43 +0100 Subject: [PATCH] Revert "Don't copy token." This reverts commit bc81053dbcc048fbd2ec60ca4cdf9d2ab4f34834. --- xmpp.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xmpp.go b/xmpp.go index 2ac0a09..d423278 100644 --- a/xmpp.go +++ b/xmpp.go @@ -1493,11 +1493,12 @@ func (c *Client) nextEnd() (xml.EndElement, error) { c.p.Strict = false for { c.nextMutex.Lock() - t, err := c.p.RawToken() - if err != nil || t == nil { + to, err := c.p.RawToken() + if err != nil || to == nil { c.nextMutex.Unlock() return xml.EndElement{}, err } + t := xml.CopyToken(to) switch t := t.(type) { case xml.EndElement: c.nextMutex.Unlock()