pidgin: e6fb2105: A couple of compile warning fixes, a cou...
sadrul at pidgin.im
sadrul at pidgin.im
Tue Sep 23 03:40:46 EDT 2008
-----------------------------------------------------------------
Revision: e6fb210583e50d36bcfe1d27266b2725786dd05d
Ancestor: d5543e6ef5e67e9c4a1fb372c06245ab36155e4b
Author: sadrul at pidgin.im
Date: 2008-09-23T07:51:55
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e6fb210583e50d36bcfe1d27266b2725786dd05d
Modified files:
libpurple/protocols/jabber/data.c
libpurple/protocols/jabber/data.h
libpurple/protocols/jabber/message.c
ChangeLog:
A couple of compile warning fixes, a couple of memory leak plugs.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/data.c 244dcce069806028c4bbc3f1554c6a06ab688799
+++ libpurple/protocols/jabber/data.c 479b5c3440f041763c657afda16047f8880745eb
@@ -82,9 +82,10 @@ jabber_data_create_from_xml(xmlnode *tag
}
-void
-jabber_data_delete(JabberData *data)
+static void
+jabber_data_delete(gpointer cbdata)
{
+ JabberData *data = cbdata;
g_free(data->cid);
g_free(data->type);
g_free(data->data);
============================================================
--- libpurple/protocols/jabber/data.h fd516b199a3e3f4c34fbb8280f66af5de341d375
+++ libpurple/protocols/jabber/data.h 4e41b1878db90fbb1cd27d32fa73d7d2bee9be5e
@@ -39,8 +39,6 @@ JabberData *jabber_data_create_from_xml(
XEP 0231 */
JabberData *jabber_data_create_from_xml(xmlnode *tag);
-void jabber_data_delete(JabberData *data);
-
const char *jabber_data_get_cid(const JabberData *data);
const char *jabber_data_get_type(const JabberData *data);
@@ -61,7 +59,7 @@ const JabberData *jabber_data_find_remot
const JabberData *jabber_data_find_local_by_alt(const gchar *alt);
const JabberData *jabber_data_find_local_by_cid(const gchar *cid);
const JabberData *jabber_data_find_remote_by_cid(const gchar *cid);
-
+
/* store data objects */
void jabber_data_associate_local(JabberData *data, const gchar *alt);
void jabber_data_associate_remote(JabberData *data);
============================================================
--- libpurple/protocols/jabber/message.c cfac4f9d5fe446dde568729192dbed522113c1a2
+++ libpurple/protocols/jabber/message.c d0342107f0b2e688a985910981abb6376530f283
@@ -428,13 +428,12 @@ jabber_message_xml_to_string_strip_img_s
if (g_str_has_prefix(src, "cid:")) {
const gchar *alt = xmlnode_get_attrib(img, "alt");
- gchar *escaped = NULL;
/* if the "alt" attribute is empty, put the cid as smiley string */
if (alt && alt[0] != '\0') {
/* if the "alt" is the same as the CID, as Jabbim does,
this prevents linkification... */
if (purple_email_is_valid(alt)) {
- const gchar *safe_alt = g_strdup_printf("smiley:%s", alt);
+ gchar *safe_alt = g_strdup_printf("smiley:%s", alt);
out = g_string_append(out, safe_alt);
g_free(safe_alt);
} else {
@@ -596,7 +595,7 @@ void jabber_message_parse(JabberStream *
const gchar *who = xmlnode_get_attrib(packet, "from");
PurpleAccount *account = purple_connection_get_account(gc);
PurpleConversation *conv = NULL;
- const GList *smiley_refs = NULL;
+ GList *smiley_refs = NULL;
gchar *reformatted_xhtml;
if (purple_account_get_bool(account, "custom_smileys", TRUE)) {
@@ -683,7 +682,7 @@ void jabber_message_parse(JabberStream *
}
/* we don't need the list of CIDs anymore */
- for (; smiley_refs ; smiley_refs = g_list_next(smiley_refs)) {
+ for (; smiley_refs ; smiley_refs = g_list_delete_link(smiley_refs, smiley_refs)) {
JabberSmileyRef *ref = (JabberSmileyRef *) smiley_refs->data;
g_free(ref->cid);
g_free(ref->alt);
@@ -888,6 +887,7 @@ jabber_message_get_smileyfied_xhtml(cons
g_free(img_text);
pos += strlen(escaped);
g_free(escaped);
+ xmlnode_free(img);
break;
} else {
/* cleanup from the before the next round... */
More information about the Commits
mailing list