diff options
author | James Booth <boothj5@gmail.com> | 2016-08-17 23:32:43 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-08-17 23:32:43 +0100 |
commit | 7b22c813c8daf7f080a098705394b4f70e0b818b (patch) | |
tree | 002dd92ed8fc86e0e9711e3e9de497e96d1e2c96 | |
parent | 9945246a648998e374c0c3a5ac56cdffc63ef13a (diff) | |
download | profani-tty-7b22c813c8daf7f080a098705394b4f70e0b818b.tar.gz |
Copy feature strings on caps_get_features
-rw-r--r-- | src/xmpp/capabilities.c | 6 | ||||
-rw-r--r-- | src/xmpp/stanza.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c index 6310352e..da74665b 100644 --- a/src/xmpp/capabilities.c +++ b/src/xmpp/capabilities.c @@ -113,17 +113,19 @@ caps_get_features(void) GList *curr = prof_features; while (curr) { - result = g_list_append(result, curr->data); + result = g_list_append(result, strdup(curr->data)); curr = g_list_next(curr); } GList *plugin_features = plugins_get_disco_features(); curr = plugin_features; while (curr) { - result = g_list_append(result, curr->data); + result = g_list_append(result, strdup(curr->data)); curr = g_list_next(curr); } + g_list_free(plugin_features); + return result; } diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 0853a345..c88df237 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -1096,7 +1096,7 @@ stanza_create_caps_query_element(xmpp_ctx_t *ctx) curr = g_list_next(curr); } - g_list_free(features); + g_list_free_full(features, free); return query; } |