Mercurial > pidgin
diff libpurple/protocols/bonjour/jabber.c @ 21465:e489c81e1f6f
Cleanup and fix the socks5 proxy connect address to be correct.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 13 Nov 2007 02:20:58 +0000 |
parents | 577d90f8794e |
children | 7a05b6f84545 |
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/jabber.c Mon Nov 12 23:20:25 2007 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Tue Nov 13 02:20:58 2007 +0000 @@ -879,17 +879,11 @@ xmlnode *iq_node = NULL; XepIq *iq = NULL; - if(data == NULL || to == NULL || id == NULL) - return NULL; - iq = g_new0(XepIq, 1); - if(iq == NULL) - return NULL; + g_return_val_if_fail(data != NULL, NULL); + g_return_val_if_fail(to != NULL, NULL); + g_return_val_if_fail(id != NULL, NULL); iq_node = xmlnode_new("iq"); - if(iq_node == NULL) { - g_free(iq); - return NULL; - } xmlnode_set_attrib(iq_node, "to", to); xmlnode_set_attrib(iq_node, "id", id); @@ -912,6 +906,7 @@ break; } + iq = g_new0(XepIq, 1); iq->node = iq_node; iq->type = type; iq->data = ((BonjourData*)data)->jabber_data; @@ -964,7 +959,7 @@ } int -xep_iq_send(XepIq *iq) +xep_iq_send_and_free(XepIq *iq) { int ret = -1; PurpleBuddy *pb = NULL; @@ -978,13 +973,16 @@ ret = _send_data(pb, msg); g_free(msg); } + xmlnode_free(iq->node); + iq->node = NULL; + g_free(iq); return (ret >= 0) ? 0 : -1; } /* This returns a ';' delimited string containing all non-localhost IPs */ -char * +const char * purple_network_get_my_ip_ext2(int fd) { char buffer[1024];