changeset 30455:e47a4a7940ea

Fix some leaks, and simplify these branches.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 23 Apr 2010 20:53:57 +0000
parents 09e15f831d7e
children 31f20c9c7674
files libpurple/protocols/msn/slp.c
diffstat 1 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Fri Apr 23 20:45:05 2010 +0000
+++ b/libpurple/protocols/msn/slp.c	Fri Apr 23 20:53:57 2010 +0000
@@ -679,6 +679,8 @@
 			 * TCP connection is not supported.
 			 */
 		}
+
+		g_free(bridges);
 	}
 	else if (!strcmp(type, "application/x-msnmsgr-transrespbody"))
 	{
@@ -827,6 +829,7 @@
 
 		content = get_token(body, "\r\n\r\n", NULL);
 
+		slpcall = NULL;
 		if (branch && call_id)
 		{
 			slpcall = msn_slplink_find_slp_call(slplink, call_id);
@@ -838,21 +841,12 @@
 			else if (content_type && content)
 			{
 				slpcall = msn_slpcall_new(slplink);
-				slpcall->id = call_id;
+				slpcall->id = g_strdup(call_id);
 				got_invite(slpcall, branch, content_type, content);
 			}
-			else
-			{
-				g_free(call_id);
-				slpcall = NULL;
-			}
-		}
-		else
-		{
-			g_free(call_id);
-			slpcall = NULL;
 		}
 
+		g_free(call_id);
 		g_free(branch);
 		g_free(content_type);
 		g_free(content);