changeset 31030:84c5575d08de

Fix a leak if an OIM SOAP request failed, probably due to the account disconnecting/closing before a reply was received.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 15 Dec 2010 00:00:12 +0000
parents fa1a0dccd4fa
children 61db10475bed
files libpurple/protocols/msn/oim.c
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/oim.c	Tue Dec 14 06:19:13 2010 +0000
+++ b/libpurple/protocols/msn/oim.c	Wed Dec 15 00:00:12 2010 +0000
@@ -166,14 +166,10 @@
 	xmlnode *fault = NULL;
 	xmlnode *faultcode = NULL;
 
-	if (response == NULL)
-		return;
+	if (response != NULL)
+		fault = xmlnode_get_child(response->xml, "Body/Fault");
 
-	fault = xmlnode_get_child(response->xml, "Body/Fault");
-	if (fault)
-		faultcode = xmlnode_get_child(fault, "faultcode");
-
-	if (faultcode) {
+	if (fault && (faultcode = xmlnode_get_child(fault, "faultcode"))) {
 		gchar *faultcode_str = xmlnode_get_data(faultcode);
 		gboolean need_token_update = FALSE;