From c6c61719b5a627ae68110ca4370a39bcfc4ff733 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 13 Feb 2016 19:30:05 +0100 Subject: m_callerid Free old extension data before unserializing the new data --- src/modules/m_callerid.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 4147f0b16..2df6d7af0 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -68,7 +68,12 @@ struct CallerIDExtInfo : public ExtensionItem void unserialize(SerializeFormat format, Extensible* container, const std::string& value) { + void* old = get_raw(container); + if (old) + this->free(old); callerid_data* dat = new callerid_data; + set_raw(container, dat); + irc::commasepstream s(value); std::string tok; if (s.GetToken(tok)) @@ -89,10 +94,6 @@ struct CallerIDExtInfo : public ExtensionItem } } } - - void* old = set_raw(container, dat); - if (old) - this->free(old); } callerid_data* get(User* user, bool create) -- cgit v1.2.3