about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-01-13 01:47:29 +0000
committerJames Booth <boothj5@gmail.com>2013-01-13 01:47:29 +0000
commitd827abddb7947a4872a20e3e2832cf2ae2f492ef (patch)
treefeab13ba62122ddb6e7b190183ccb89b910143c1 /src
parentb6f36673900939ad171b84bb088d82226d06285a (diff)
downloadprofani-tty-d827abddb7947a4872a20e3e2832cf2ae2f492ef.tar.gz
Added jid_destroy()
Diffstat (limited to 'src')
-rw-r--r--src/jid.c12
1 files changed, 12 insertions, 0 deletions
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 <glib.h>
 
+#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