Mercurial > pidgin
comparison libpurple/protocols/jabber/caps.c @ 25031:3f719eaa7fd1
* IPC work
* removed g_free which may've resulted in a bug
author | Tobias Markmann <tfar@soc.pidgin.im> |
---|---|
date | Tue, 08 Jul 2008 15:05:45 +0000 |
parents | 61f37abc8a70 |
children | 7f6558c7a0a3 |
comparison
equal
deleted
inserted
replaced
25030:61f37abc8a70 | 25031:3f719eaa7fd1 |
---|---|
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 static void jabber_caps_store(void) { | 228 static void jabber_caps_store(void) { |
229 char *str; | 229 char *str; |
230 int length = 0; | |
230 xmlnode *root = xmlnode_new("capabilities"); | 231 xmlnode *root = xmlnode_new("capabilities"); |
231 g_hash_table_foreach(capstable, jabber_caps_store_client, root); | 232 g_hash_table_foreach(capstable, jabber_caps_store_client, root); |
232 str = xmlnode_to_formatted_str(root, NULL); | 233 str = xmlnode_to_formatted_str(root, &length); |
233 xmlnode_free(root); | 234 xmlnode_free(root); |
234 purple_util_write_data_to_file(JABBER_CAPS_FILENAME, str, -1); | 235 purple_util_write_data_to_file(JABBER_CAPS_FILENAME, str, length); |
235 g_free(str); | 236 g_free(str); |
236 } | 237 } |
237 | 238 |
238 /* this function assumes that all information is available locally */ | 239 /* this function assumes that all information is available locally */ |
239 static JabberCapsClientInfo *jabber_caps_collect_info(const char *node, const char *ver, GList *ext) { | 240 static JabberCapsClientInfo *jabber_caps_collect_info(const char *node, const char *ver, GList *ext) { |
533 key->hash = (char*)hash; | 534 key->hash = (char*)hash; |
534 | 535 |
535 client = g_hash_table_lookup(capstable, key); | 536 client = g_hash_table_lookup(capstable, key); |
536 | 537 |
537 g_hash_table_replace(jabber_contact_info, g_strdup(who), key); | 538 g_hash_table_replace(jabber_contact_info, g_strdup(who), key); |
538 g_free(key); | |
539 | 539 |
540 if(!client) { | 540 if(!client) { |
541 JabberIq *iq = jabber_iq_new_query(js,JABBER_IQ_GET,"http://jabber.org/protocol/disco#info"); | 541 JabberIq *iq = jabber_iq_new_query(js,JABBER_IQ_GET,"http://jabber.org/protocol/disco#info"); |
542 xmlnode *query = xmlnode_get_child_with_namespace(iq->node,"query","http://jabber.org/protocol/disco#info"); | 542 xmlnode *query = xmlnode_get_child_with_namespace(iq->node,"query","http://jabber.org/protocol/disco#info"); |
543 char *nodever = g_strdup_printf("%s#%s", node, ver); | 543 char *nodever = g_strdup_printf("%s#%s", node, ver); |