about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-09-24 01:06:49 +0100
committerJames Booth <boothj5@gmail.com>2014-09-24 01:06:49 +0100
commit41f4621e6ffbb43a7fc650f15598a518ec1308a8 (patch)
tree3d910a7454551e276e3ee6752095be19d92ad580 /src/xmpp
parenta288c200d70e83138e404afa52968874255d9822 (diff)
downloadprofani-tty-41f4621e6ffbb43a7fc650f15598a518ec1308a8.tar.gz
Free caps, remove strdup
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/capabilities.c4
-rw-r--r--src/xmpp/iq.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c
index 94523a30..dc19e143 100644
--- a/src/xmpp/capabilities.c
+++ b/src/xmpp/capabilities.c
@@ -110,7 +110,7 @@ caps_add(const char * const ver, Capabilities *caps)
             const gchar* features_list[num];
             int curr = 0;
             while (curr_feature) {
-                features_list[curr++] = strdup(curr_feature->data);
+                features_list[curr++] = curr_feature->data;
                 curr_feature = g_slist_next(curr_feature);
             }
             g_key_file_set_string_list(cache, ver, "features", features_list, num);
@@ -426,6 +426,8 @@ caps_create(xmpp_stanza_t *query)
         }
     }
 
+    g_slist_free(identity_stanzas);
+
     if (found) {
         category = xmpp_stanza_get_attribute(found, "category");
         type = xmpp_stanza_get_attribute(found, "type");
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index f701aa53..122a2d12 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -392,6 +392,7 @@ _caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
             log_info("Capabilities not cached: %s, storing", given_sha1);
             Capabilities *capabilities = caps_create(query);
             caps_add(given_sha1, capabilities);
+            caps_destroy(capabilities);
         }
 
         caps_map(from, given_sha1);