diff options
-rw-r--r-- | src/modules/m_callerid.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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) |