about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-08-09 01:10:02 +0100
committerJames Booth <boothj5@gmail.com>2015-08-09 01:10:02 +0100
commit131f1788c24949169c0e8c255303dc6bc4ba0308 (patch)
treee21461cec488474068885ff5c5c712e7dabb754b /src/xmpp
parent3b79d5aa631469cb9c5d497d68c5d9fd084dcb92 (diff)
downloadprofani-tty-131f1788c24949169c0e8c255303dc6bc4ba0308.tar.gz
Free software version result properties
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/iq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index db817e13..496e9caa 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -892,6 +892,8 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
         log_warning("From attribute specified different JID, using original JID.");
     }
 
+    xmpp_ctx_t *ctx = xmpp_conn_get_context(conn);
+
     Jid *jidp = jid_create((char*)userdata);
     const char *presence = NULL;
     if (muc_active(jidp->barejid)) {
@@ -902,6 +904,9 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
         Resource *resource = p_contact_get_resource(contact, jidp->resourcepart);
         if (!resource) {
             ui_handle_software_version_error(jidp->fulljid, "Unknown resource");
+            if (name_str) xmpp_free(ctx, name_str);
+            if (version_str) xmpp_free(ctx, version_str);
+            if (os_str) xmpp_free(ctx, os_str);
             return 0;
         }
         presence = string_from_resource_presence(resource->presence);
@@ -912,6 +917,10 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
     jid_destroy(jidp);
     free(userdata);
 
+    if (name_str) xmpp_free(ctx, name_str);
+    if (version_str) xmpp_free(ctx, version_str);
+    if (os_str) xmpp_free(ctx, os_str);
+
     return 0;
 }