mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Free caps, remove strdup
This commit is contained in:
parent
a288c200d7
commit
41f4621e6f
@ -110,7 +110,7 @@ caps_add(const char * const ver, Capabilities *caps)
|
|||||||
const gchar* features_list[num];
|
const gchar* features_list[num];
|
||||||
int curr = 0;
|
int curr = 0;
|
||||||
while (curr_feature) {
|
while (curr_feature) {
|
||||||
features_list[curr++] = strdup(curr_feature->data);
|
features_list[curr++] = curr_feature->data;
|
||||||
curr_feature = g_slist_next(curr_feature);
|
curr_feature = g_slist_next(curr_feature);
|
||||||
}
|
}
|
||||||
g_key_file_set_string_list(cache, ver, "features", features_list, num);
|
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) {
|
if (found) {
|
||||||
category = xmpp_stanza_get_attribute(found, "category");
|
category = xmpp_stanza_get_attribute(found, "category");
|
||||||
type = xmpp_stanza_get_attribute(found, "type");
|
type = xmpp_stanza_get_attribute(found, "type");
|
||||||
|
@ -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);
|
log_info("Capabilities not cached: %s, storing", given_sha1);
|
||||||
Capabilities *capabilities = caps_create(query);
|
Capabilities *capabilities = caps_create(query);
|
||||||
caps_add(given_sha1, capabilities);
|
caps_add(given_sha1, capabilities);
|
||||||
|
caps_destroy(capabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
caps_map(from, given_sha1);
|
caps_map(from, given_sha1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user