diff --git a/src/jid.c b/src/jid.c index 90d225bc..7955b98c 100644 --- a/src/jid.c +++ b/src/jid.c @@ -25,6 +25,7 @@ #include +#include "common.h" #include "jid.h" Jid * @@ -110,6 +111,17 @@ jid_create_room_jid(const char * const room, const char * const nick) return result; } +void +jid_destroy(Jid *jid) +{ + FREE_SET_NULL(jid->localpart); + FREE_SET_NULL(jid->domainpart); + FREE_SET_NULL(jid->resourcepart); + FREE_SET_NULL(jid->barejid); + FREE_SET_NULL(jid->fulljid); + FREE_SET_NULL(jid); +} + /* * Given a full room JID of the form * room@server/nick